View previous topic :: View next topic
|
Author |
Message |
cvnlynn
New User
Joined: 14 Jun 2017 Posts: 31 Location: US
|
|
|
|
I want to convert following clist to rexx
SELECT
WHEN (&TCLIST not equal &z) %&TCLIST
END
note: I couldn't find the symbol for 'equal' |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
Code: |
if (tclist\='') then
call tclist
|
|
|
Back to top |
|
|
steve-myers
Active Member
Joined: 30 Nov 2013 Posts: 917 Location: The Universe
|
|
|
|
cvnlynn wrote: |
I want to convert following clist to rexx
SELECT
WHEN (&TCLIST not equal &z) %&TCLIST
END
note: I couldn't find the symbol for 'equal' |
I'm sure you meant not equal; equal is =, on the same key (probably) as +.
You probably meant ¬= . The TTY oriented people that defined ASCII apparently didn't think about ¬ so it's not on most PC keyboards.
Some - not all - 3270 emulators will send ¬ if you press Ctrl-6.
Rexx has serveral equivalents. <>, for example, is used by some people. TSO/E Rexx Reference for your z/OS release - which you should have consulted before you started this topic - probably has some alternatives. Look it up.
You ask how the !#% did you get the ¬ symbol into this message? Simple. My 3270 emulator sends ¬ and displays it properly. I got it in, and copied it from the 3270 screen to this message. |
|
Back to top |
|
|
cvnlynn
New User
Joined: 14 Jun 2017 Posts: 31 Location: US
|
|
|
|
TCLIST is the REXX pgm, so does the CALL TCLIST work?
can I use ADDRESS 'ISPEXEC' 'SELECT CMD(%&TCLIST)' |
|
Back to top |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 712 Location: Denmark
|
|
|
|
I strongly suggest that you start reading the 'TSO/E REXX Reference' manual chapter 2 ' REXX general concepts' - and then of course the rest of the manual, if you want to code in REXX. |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
Why not try a little experiment? |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2022 Location: USA
|
|
|
|
Akatsukami wrote: |
Code: |
if (tclist\='') then
call tclist
|
|
In CLIST sample given above the element TCLIST is supposed to be a variable name.
If so, this portion of CLIST:
is equivalent in REXX to the following:
Code: |
Interpret "Call" TCLIST |
isn't it?
The whole sample must be
Code: |
If TCLIST /= '' Then Interpret "Call" TCLIST |
|
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
I believe that if, e.g., tclist has the value "FOO", then the statement
will be interpreted as
without using the interpret statement. |
|
Back to top |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 712 Location: Denmark
|
|
|
|
I would recommend this syntax:
Address TSO "%"tclist
no need for the Interpret as earlier mentioned.
If you are already in an ADDRESS TSO block then you can leave that out and just have "%"tclist. And you can use either single or double quotes, I just prefer double quotes for this stuff. Note, those are double quotes, not 2 single quotes. |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2022 Location: USA
|
|
|
|
Willy Jensen wrote: |
I would recommend this syntax:
Address TSO "%"tclist
no need for the Interpret as earlier mentioned.
If you are already in an ADDRESS TSO block then you can leave that out and just have "%"tclist. And you can use either single or double quotes, I just prefer double quotes for this stuff. Note, those are double quotes, not 2 single quotes. |
Yes, but...
Not all routines are running in TSO address space, and/or expect to be called in this environment.
The main point here is exactly the same: need to resolve program name from variable before performing the actual call. |
|
Back to top |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 712 Location: Denmark
|
|
|
|
This discussion started being about CLIST, which as far as I know only runs under TSO. Also the OP stated he wanted to convert %something which is a TSO only construct specifically for calling another CLIST or REXX. If you need to extend the call to something more generic, then this should do:
""tclist
still no need for 'Interpret'. |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2022 Location: USA
|
|
|
|
Willy Jensen wrote: |
This discussion started being about CLIST, which as far as I know only runs under TSO. Also the OP stated he wanted to convert %something which is a TSO only construct specifically for calling another CLIST or REXX. If you need to extend the call to something more generic, then this should do:
""tclist
still no need for 'Interpret'. |
FYI:
Code: |
/* REXX */
TestCall:
Call Subprog "1"
Prog = 'SubProg'
Interpret "Call" Prog "2"
Call ""Prog "3"
Call Prog "4"
return 0
/****************************************************************/
SubProg:
Arg Parm
Say "Called SubProg" Parm
return
/****************************************************************/ |
Code: |
-DSC- TSO COMMAND SHELL Row 1 to 13 of 814
*** Press ENTER to execute the displayed command. ***
===> calling
Enter: TSO command, CLIST, REXX EXEC, or ISPEXEC statement. Scroll => CSR
Called SubProg 1
Called SubProg 2
Exec member name must be specified when the exec load DD refers to a partitione
d data set.
9 +++ Call ""Prog "3"
Error running CALLING, line 9: Routine not found
***
11 +++ Call Prog "4"
Error running CALLING, line 11: Routine not found
*** |
|
|
Back to top |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 712 Location: Denmark
|
|
|
|
Please note I did not suggest 'CALL ""pgmname'
I suggested ""pgmname or "%"pgmname
Both these versions works:
Code: |
pgm='ECHO'
data='kilroy was here'
"%"pgm "'"data"'"
""pgm "'"data"'"
|
This does not, as you found out:
Code: |
pgm='ECHO'
data='kilroy was here'
Call ""pgm "'"data"'"
|
|
|
Back to top |
|
|
|