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

How to set variable in TACL PARAM

656 views
Skip to first unread message

ray

unread,
Feb 26, 2014, 6:18:32 AM2/26/14
to
Dear,
I want to set Param-value is dynamic value in TACL.
Sample code:
Push rundate ( it is yyyymmdd)
.....
....
Param startdate [rundate]
Param enddate [rundate]
Run $dev.ray.extlog
....
The rundate variable value is 20140226,tomorrow value is 20140227
I can #output rundate(it it 20140226).
But, Param startdate [rundate] is not correct value.
Could you help me how to solve the problem?

Keith Dick

unread,
Feb 26, 2014, 8:19:52 AM2/26/14
to
I assume you meant to say that:

#output [rundate]

displays 20140226 as the value. If you really did not have square brackets around rundate in the #output command, I don't know what to think.

Anyway, the TACL code you show seems correct. An important fact you did not tell us is what the incorrect value of startdate is. You said it is incorrect, but you did not tell us what value it has or how you checked its value.

The first thing I would do is add the commands:

#output [rundate]
param

immediately before the run command. The #output command, of course, is to check the value of rundate at exactly this point in your TACL code. The param command with no arguments will display the names and values of all the params. If the values displayed are correct, then you know the problem is that your program is not retrieving the value of the params correctly. If the values displayed by the #output or the empty param command are not correct, then we have to check your TACL code to see what is wrong.

dave....@gmail.com

unread,
Feb 26, 2014, 9:10:53 AM2/26/14
to
Looks good to me too.

$DATA DAVE 1> push rundate
$DATA DAVE 2> #set rundate 20140226
$DATA DAVE 3> param startdate [rundate]
$DATA DAVE 4> param
TCPIP^RESOLVER^ORDER .HOSTFILE-DNS.
STARTDATE .20140226.

Dave
Message has been deleted

ray

unread,
Feb 26, 2014, 11:20:32 AM2/26/14
to
dear ,
I have TACL obey file.
---- Content ----
#PUSH rundate ,yyyy,mm,dd,hour
#SETMANY yyyy mm dd hour [#CONTIME [#TIMESTAMP]]
#OUTPUT [yyyy][mm][dd]

PARAM START-DATE [yyyy][mm][dd]
PARAM END-DATE [yyyy][mm][dd]
RUN $DEV.RAY.OBJX
--------------------
When I obey this TACL file.
I can see 20140226 => #OUTPUT [yyyy][mm][dd]
I do not see PARAM START-DATE [yyyy][mm][dd] became PARAM START-DATE 20140226
any suggestion ? Thanks !

Keith Dick

unread,
Feb 26, 2014, 11:33:00 AM2/26/14
to
Yes, I had suggestions in my first reply, but you seem not to want to do them.

This post does give a little more information, but it can't be trusted, since I believe the #setmany command you show cannot possible work because it is missing the comma that should separate the output variables from the text to be broken down and assigned to those variables. So I conclude that you are not showing us exactly the TACL code you are running.

Is there any chance you have a TACL macro or routine named PARAM? Or you have a program named PARAM? I'm not sure whether either would take precedence over the TACL PARAM command, but one of them might be hiding the TACL PARAM command.

I repeat from my earlier reply: Add a PARAM command with no arguments between the PARAM commands you have and the RUN command you have. That will show us whether TACL is setting up the PARAM values correctly or not. If not, we have to figure out why your PARAM commands are not working. If the empty PARAM command shows the parameters to be set correctly, then your program is not retrieving the PARAM values correctly.

dave....@gmail.com

unread,
Feb 26, 2014, 11:35:04 AM2/26/14
to
You have a couple of issues....

First you forgot the comma in the SETMANY (after hour) so that is not working.

After that works you will need to fill in the missing zero in the month. If you look at this thread you will find some examples of how to do this:

https://groups.google.com/forum/#!topic/comp.sys.tandem/v4RSuoHl1Fc

$DATA DAVE 6> #PUSH rundate ,yyyy,mm,dd,hour
$DATA DAVE 7> #SETMANY yyyy mm dd hour,[#CONTIME [#TIMESTAMP]]
$DATA DAVE 7..
$DATA DAVE 8> #OUTPUT [yyyy][mm][dd]
2014226
$DATA DAVE 9> PARAM START-DATE [yyyy][mm][dd]
$DATA DAVE 10> param
TCPIP^RESOLVER^ORDER .HOSTFILE-DNS.
START-DATE .2014226.

Also you might want to put a #FRAME at the start and #UNFRAME at the end of your obey file to clear the temporary variables you have pushed.

Dave

Robert Hutchings

unread,
Feb 26, 2014, 11:51:17 AM2/26/14
to
Instead of using an OBEY file, this could be a TACL MACRO instead...

If you have a file called MYMACS or TACLCSTM, add this:

?SECTION set_run_date_param MACRO
#frame
#push run-date yyyy mm dd hour
#setmany yyyy mm dd hour, [#CONTIME [#TIMESTAMP]]
PARAM START-DATE [yyyy][mm][dd]
#unframe


Keith Dick

unread,
Feb 26, 2014, 11:59:18 AM2/26/14
to
While what you say is true, how does it contribute to solving the little mystery of Ray's statement that the PARAM is not getting the right value?

Robert Hutchings

unread,
Feb 26, 2014, 12:27:26 PM2/26/14
to
Maybe it doesn't contribute much, and I think the #setmany syntax error was the original (or one of the original) problem(s).

I just have a personal distaste for OBEY files that use a lot of TACL built-in functions. I think those should be MACROS or even TACL programs. Perhaps my personal preference is not that helpful here...

Message has been deleted

ray

unread,
Feb 26, 2014, 8:50:50 PM2/26/14
to
Dear all,
Thanks all.The problem is solved.Here is obey file.
I OBEY the file(EXTRAY).It is workable.
==== File "EXTRAY" Content ====
#SET #INFORMAT TACL
PUSH yyyy mm dd rundate
#SETMANY yyyy mm dd ,[#CONTIME [#TIMESTAMP]]
[#if [mm] < 10 |then| #set mm 0[mm]]
[#if [dd] < 10 |then| #set dd 0[dd]]
#SET rundate [yyyy][mm][dd]
#OUTPUTV rundate ==> value is 20140227

PARAM START-DATE [rundate]
PARAM END-DATE [rundate]
ASSIGN FNF, $DEV.UB12CTLP.FNF
PARAM
SET HIGHPIN ON
RUN $DEV.ray.obj / NAME $URAY,PRI 150/

TIME
=============

Doug Miller

unread,
Feb 26, 2014, 11:05:28 PM2/26/14
to
ray <yehr...@gmail.com> wrote in news:238ba004-7366-4865-a16b-966100288321
@googlegroups.com:

> dear ,
> I have TACL obey file.
> ---- Content ----
> #PUSH rundate
> #SETMANY yyyy mm dd hour [#CONTIME [#TIMESTAMP]]

You're missing a comma. That should be
#SETMANY yyyy mm dd hour, [#CONTIME [#TIMESTAMP]]

> PARAM START-DATE [yyyy][mm][dd]
> PARAM END-DATE [yyyy][mm][dd]
> RUN $DEV.RAY.OBJX
> --------------------
> I do not see PARAM START-DATE [yyyy][mm][dd] => PARAM START-DATE 20140226
> any suggestion ? Thanks !

So what *do* you see? I'm betting you have 2014226 instead, right?

After the #SETMANY command, you also should have:
[#IF [dd] < 10 |THEN| #SET dd 0[dd]]
[I#F [mm] < 10 |THEN| #SET mm 0[mm]]

aip.stu...@gmail.com

unread,
May 3, 2017, 9:50:53 AM5/3/17
to
On Wednesday, February 26, 2014 at 11:05:28 PM UTC-5, Doug Miller wrote:
> ray wrote in news:238ba004-7366-4865-a16b-966100288321
Hi,

To follow up some real basic questions of TACL, would you please help me with the clarifications/questions?

1. Why don't I need to use #push to push the variable? I noticed that with the pond sign it also worked.
2. Why do I must use the pond sign for the set command?
3. What's the significance of using the param command? It seems to me sometimes I must use this construct [#rundate] and sometimes not (in the example above, it didn't use the pond sign in front of rundate.

Thank you so much for the great help in advance!

Sincerely,

TACL student

Keith Dick

unread,
May 3, 2017, 3:02:14 PM5/3/17
to
You do need the #push for every variable. It is not there in the fragment you included in your post.
I imagine it was there in a more complete version of the code, though I did not go back to look for it.

I am not sure which pound sign you mean could be omitted. Some TACL commands can be written both with the #
and without it. I do not know why TACL has two spellings of some of its commands.

2. Why do I must use the pond sign for the set command?

I believe you could use either "#set" or "set variable" in this example. You cannot use just "set"
because TACL has several other set commands (set define, set defmode, etc.), so just "set" by itself is
not accepted.

3. What's the significance of using the param command? It seems to me sometimes I must use this construct [#rundate] and
sometimes not (in the example above, it didn't use the pond sign in front of rundate.

PARAM is used to create an item that TACL sends to a new process when TACL starts a new process. Ordinary TACL
variables do not get sent to a new process. The items created by PARAM can send parameters to the new process
that it can read to control decisions made in the program.

I do not see [#rundate] or [rundate] in the part of the example you posted. Maybe one of them was used in a more
complete version. Since "rundate" is the name of a user-created TACL variable, you would not put a pound sign
in front of it.

The pound sign is just part of the name of some TACL commands or TACL built-in variables. It is not a TACL operator
or TACL function. You use the pound sign when it is is part of the name of the TACL command or TACL built-in variable
you want to use. I guess you are confused because some TACL commands have two names -- one with the pound sign and
one without the pound sign. Those are just two names for the same command.

You did not seem to ask about this, but let me mention that square brackets ( [] ) are used to enclose a series of
TACL symbols that should be evaluated as a group, then the result of that evaluation is substituted for the square
brackets and everything enclosed by them. When square brackets are nested within other square brackets, the inner
group is evaluated first. If you ever get confused about how a complex TACL expression is evaluated, it is a pretty
simple rule:

- read the TACL line from left to right until you encounter a right square bracket ( "]" ).
- find the first right square bracket ( "[" ) to the left of the "]".
- evaluate what is between those two square brackets.
- put the result of the evaluation in place of what you just evaluated.
- go back to the beginning of the line and repeat.

I am omitting some details from the above description that are important when defining functions, but this will do
for most common situations.

Good luck!
0 new messages