Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

TACL macro to run in background

536 views
Skip to first unread message

neeraj kumar

unread,
Jul 7, 2015, 11:13:45 AM7/7/15
to
Hi All,

I have one ROUTINE name : ABCTEST(runs in infinite loop).

When i type this ROUTINE directly on TACL prompt it produces file as expected since it runs in infinite loop so it remains in tacl prompt.

What my requirement is to run this macro in background.

What i did:

I have created one run file :

ABCTEST1: It contains

?tacl macro
tacl /in ABCTEST, out $null, term $alt1, name $test, nowait/

when i fire run macro ABCTEST1 command it do nothing. No error is prompted and no file is generated.

Changes i did to see error in run macro

?tacl macro
tacl /in ABCTEST, out testout, term $alt1, name $test, nowait/


When i did fup copy on testout. It shows error to very first line :

?TACL ROUTINE
^
*ERROR* No such line

Please suggest if anyone have any idea how to resolve this issue.

wbreidbach

unread,
Jul 7, 2015, 11:25:49 AM7/7/15
to
That does not work this way, a TACL macro cannot be used as TACL infile. So you should create a 3rd file OABCTEST just containing
run abctest

ABCTEST should be:

?tacl macro
tacl /in OABCTEST, out $null, term $alt1, name $test, nowait/

wbreidbach

unread,
Jul 7, 2015, 11:27:10 AM7/7/15
to
Ooops, just to tell the complete truth:
You can use a TACL macro as infile but it will be treated as an obey-file, not as a macro.

neeraj kumar

unread,
Jul 7, 2015, 12:07:23 PM7/7/15
to
Hi,

I am going to implement what you have suggested, but i am using TACL /IN ABCTEST

and ABCTEST is: ?TACL ROUTINE, so my question is that will routine is also treated as macro?

neeraj kumar

unread,
Jul 7, 2015, 12:17:29 PM7/7/15
to
Thanx, it is working as suggested by you.

But thing is that the same code is running in our system.... same ?tacl routine is running through TACL /IN <filename>

So it's strange for me same macro is running at one place and same piece of code is not running at another location location through TACL /IN

Keith Dick

unread,
Jul 7, 2015, 2:51:31 PM7/7/15
to
There must be something different about the two ways you are using that file. I can't tell you what is different, since you did not describe both situations completely, but there must be some difference, otherwise the results would not be different.

I'll tell you some things about TACL that you might not be completely understanding, and maybe that will let you figure out why things are working differently in your two situations.

When you put TACL code into a file that you want to invoke by using that file's name, you have two ways to do it (or three ways, depending on whether you consider a macro different from a routine).

The simplest way is to create a file to be used as the IN file to TACL or as the file named in an OBEY command. The lines in such a file are interpreted by TACL just as if you had typed them at a TACL prompt.

The other way is to include "?TACL MACRO" or "?TACL ROUTINE" as the first line of the file and invoke the file with a RUN command. That can be either an explicit RUN command or an implicit RUN command, in which you just type the name of the file as the first word on the line. For an implicit RUN command, you must ensure that the #PMSEARCHLIST built-in variable includes the subvolume that contains the file, so the RUN command will find the file.

I assume you know the difference between a MACRO and a ROUTINE, so I won't explain that, but let me mention that a file is regarded by TACL as a MACRO or ROUTINE only when the file is invoked by a RUN command and contains a ?TACL line as the first line of the file. In particular, a ?TACL line that is encountered in TACL's IN file does not make the following lines be interpreted as a MACRO or a ROUTINE. In fact, there is a TACL command named "?", which displays a line from the command history that matches the specification following the "?". So a line like "?TACL ROUTINE", when read from TACL's IN file, is a command to display a line from the command history that contains the text "TACL ROUTINE".

That explains the error message you saw when you ran TACL with ABCTEST as its IN file. The error when a ? command does not find a matching line in the command history is not fatal. TACL continues to read lines and tries to execute them. If you did not see any other error messages in testout, I don't know why the other TACL commands in ABCTEST did not do their job of creating the file you expected. I suppose you would not have said the file was a ROUTINE if it does not use some of the features that are peculiar to ROUTINEs, such as #ARGUMENT, so I guess it is not very surprising that the TACL commands did not work as expected, since they were not being interpreted as in a ROUTINE. However, I would expect that you would have seen other error messages besides the one about the "?" command not finding a line to display. But since you did not show the commands in ABCTEST, I don't have enough information to analyze that point any further.

I don't know whether any of that information is new for you, or whether it helps you figure out why your file seems to work as you expect in one situation but not in another situation. That is all I can think to tell you right now. If that is not enough to let you figure out why your ?TACL ROUTINE file works as an IN file in one situation but not in another, and if you want to figure it out, post again with some more description of the two cases, and we might be able to help you figure out the difference.
Message has been deleted

neeraj kumar

unread,
Jul 8, 2015, 12:03:04 PM7/8/15
to
Keith,

Thank you for such a wonderful explanation.

Yes after ?TACL ROUTINE macro proceeded and it shows error :

Eg:

[#CASE [#EXCEPTION]
^
*ERROR* No routine has been called

#FILTER _BREAK _ERROR parameters
^
*ERROR* No routine has been called

#SET stop^it NO
^
Expecting /

Now i will explain the whole scenario:

I have main tacl routine:
CSLSTEST
CSLSTEST : Runs in infinite loop. Creates file of TEMPDDMM format.
eg.(In this way it executes when i directly fire command in TACL)

$DATA11 NKUMAR 39> CSLSTEST
07 08 15
CSL1 Starting
CSL1 Started
CSL2 Starting
CSL2 Started



My requirement: To run this routine in background. Because it keep on running in TACL prompt. So i need to run macro in background.

What I did initially:

I have created file :

CSLRUN : It contains below command:

?tacl macro
tacl /in cslstest, out $null, term $alt1, name $test, nowait/

$DATA11 NKUMAR 41> CSLRUN

I have executed this macro by supplied nowait parameter, so that it will run CSLSTEST macro in background,

$DATA11 NKUMAR 38> fi

$DATA11.NKUMAR
CODE EOF LAST MODIFIED OWNER RWEP PExt SExt
CSLRUN 101 188 07JUL2015 17:49 8,31 GOGO 14
CSLSTEST 101 11344 07JUL2015 15:47 8,31 GOGO 14
TEMP0708 101 2048 08JUL2015 13:17 8,31 GOGO 14

But it never happened, CSLSTEST macro was not in open state as you can see above.

As of now I have used the alternative as per the above suggestion:

I have created file OCSLRUN: it contains
Fi OCSLRUN
run CSLSTEST

and changed macro CSLRUN:

fi CSLRUN
?tacl macro
tacl /in OCSLRUN, out $null, term $alt1, name $test, nowait/

Now when i run CSLRUN it is working fine.

Concern: We can do it other way through: TACL IN, But why it is not working.
Meanwhile issue is resolved but alternative didn't worked.

Bill Honaker

unread,
Jul 8, 2015, 1:15:18 PM7/8/15
to
Neeraj,

Another option is to restructure the CLSRUN file to 'define' the macro
and then run it.

Remove the '?TACL ROUTINE' from the first line.Add this to the
beginning of the file:

#DEF :runClsRun ROUTINE |BODY|

and this to the end:

]
[:runClsRun]

This should work by defining the routine and then invoking it, which
is what you want to accomplish.

neeraj kumar

unread,
Jul 9, 2015, 8:49:24 AM7/9/15
to
Hey Bill,

Thanks for suggestion, it worked.

I know you. I have used many macros which you have created for greyhound. I was working in Greyhound project previously.

Just Wanted to say thanx directly for all your help related to RMS, at that time did not get a chance to thank you directly because we mostly don't communicate with you directly.

Bill Honaker

unread,
Jul 9, 2015, 1:24:40 PM7/9/15
to
Reeraj,

I thought I recognized the name. Are you still with First Group? Lots
has changed at Greyound since that project!

Bill Honaker

unread,
Jul 9, 2015, 1:33:05 PM7/9/15
to
Meant to use the salutation with your name spelled correctly, Neeraj,
my apologies!

neeraj kumar

unread,
Jul 10, 2015, 4:01:50 AM7/10/15
to
No issue Bill its fine.

No actually first group has in-housed there project. So the project contract ends with our company. Now i am working with different client ATOC its UK based project.
0 new messages