× Discuss on Template programming, jBASE programming, Enquiries, No-File enquiry, Enquiry routines, Version, Version routines, Menus, Abbriviations, Creating local reference fields, Fast path enquiries, Creating charts and graphs, Generating Reports, Deal slips, Straight through processing, Multi Company and Multi Book setup, Tabbed screens, Composite Screens, T24 API, etc...

Executing Shell command in routine ?

  • Moe_T24
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • T24 Technical
  • Posts: 57
  • Thank you received: 1

Moe_T24 created the topic: Executing Shell command in routine ?

Hi guys ,

I'm trying to concat some extracted files in one file using a batch job routine .
When I run the service in DEBUG mode , and reach the line that executes the command
CMD = 'SH "cat ': FULL.NAME : '.txt.' : TODAY :'.*' : '>>':'/home/t24user/Extract/stmt':'.txt.':TODAY:'"'

I get the follwoing error :
Cannot find file /glodev5/r15upd/r15upd/bnk/bnk.run/tmp/R15_DAT_Interface_1.SOURCE/SH
Please enter the full path to the source or 'I' to ignore.

I don't know what is this path, and how to fix it ?
P.S : I'm using TAFJ R15

Any ideas ??!!

Best Regards
#20621

Please Log in or Create an account to join the conversation.

  • VK
  • VK's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • R13|TAFC|jBASE|windoze
  • Posts: 602
  • Thank you received: 88

VK replied the topic: Executing Shell command in routine ?

Hi
Looks like you're under Linux or Unix; why then "SH" in upper case?

also, what the following commands show? (I quote the TAFC analog, don't know what's in TAFJ):

jshow -c SH
CT VOC SH

Cheers
VK
#20622

Please Log in or Create an account to join the conversation.

  • Moe_T24
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • T24 Technical
  • Posts: 57
  • Thank you received: 1

Moe_T24 replied the topic: Executing Shell command in routine ?

Hi VK ,

Yes I'm under Unix . This was originally a TAFC routine , then I tried to compile and run on TAFJ .

when I run tShow -c SH (equiv. to jShow ) , I get the following :

Project : 'xxxx' [MISSING]
No such routine : '-c' (com.temenos.t24._m_c_1_cl.class)
[ FOUND ]
BASIC source : '/glodev5/r15upd/r15upd/bnk/bnk.run/tmp/R15_DAT_Interface_1.SOURCE/SH'
BASIC package : ''
BASIC Import(s) : 'com.temenos.t24'
JAVA class : 'file:/home/t24user/'xxxx' /jars/t24lib/DAT_Interface.jar!/com/temenos/t24/SH_cl.class'
Compiled the : 03 Jul 2015 15:46:47
on : maa2devax4
Compiled with TAFJ : R15_SP2.0
Timestamp : 1435918607632
Grammar : 3
Include Basic Replacement : false

Best Regards
#20629

Please Log in or Create an account to join the conversation.

  • VK
  • VK's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • R13|TAFC|jBASE|windoze
  • Posts: 602
  • Thank you received: 88

VK replied the topic: Executing Shell command in routine ?

Hi
it looks that what was SH executable under TAFC (compiled jBC code) is now Java class...

I afraid you either have to find the way to run the native cat command (probably via shell script) or to CALLJ SH class...

Or maybe, use jBC READSEQ..WRITESEQ to copy file contents.

Cheers
VK
#20631

Please Log in or Create an account to join the conversation.

  • Posts: 19
  • Thank you received: 1

subhashmurali replied the topic: Executing Shell command in routine ?

Hi VK,

Hope you are doing good.

I am trying to perform EXECUTE command in TAFJ routine, however I can see the script is running (as it is taking sometime) but CAPTURING variable doesn't return any values. I have tried RETURNING variable also it didn't work. Appreciate if you could through some light on this returning values.

Thanks,
Murali
#20919

Please Log in or Create an account to join the conversation.

  • VK
  • VK's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • R13|TAFC|jBASE|windoze
  • Posts: 602
  • Thank you received: 88

VK replied the topic: Executing Shell command in routine ?

Hi
I'm OK thank you.
Can you try to redirect the output of your script to a file. To be able to use redirection, you need to use "Korn shell" mode (see jbc.temenos.com/pages/execute.html ). It works even under Windows.
e.g.:
EXECUTE CHAR(255) : 'kWHERE (VN > file.txt'
.. and see if there's anything in file.txt...

Cheers
VK
#20921
The following user(s) said Thank You: subhashmurali

Please Log in or Create an account to join the conversation.

  • Posts: 1
  • Thank you received: 0

Ashwini04 replied the topic: Executing Shell command in routine ?

Hi Guys ,

I have a doubt while executing a shell script in TAFJ

Please find below the program

PROGRAM TEST.GET.SYSTEM.INFO
EXECUTE "SH -c proc.sh" CAPTURING OUTPUT
CRT OUTPUT
END

I tried to run this program , but I am getting empty output. But when I run the script "proc.sh" in the TAFJ environmnent, I am able
to get the output
#22045

Please Log in or Create an account to join the conversation.

  • VK
  • VK's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • R13|TAFC|jBASE|windoze
  • Posts: 602
  • Thank you received: 88

VK replied the topic: Executing Shell command in routine ?

Hi
Looks like TAFJ does not support CAPTURING option... Try to redirect the output as I suggested in one of the messages above.

Cheers
VK
#22051

Please Log in or Create an account to join the conversation.

Time to create page: 0.218 seconds