IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Convert CLIST to REXX


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
cvnlynn

New User


Joined: 14 Jun 2017
Posts: 31
Location: US

PostPosted: Tue Jun 27, 2017 2:06 am
Reply with quote

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
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Tue Jun 27, 2017 2:55 am
Reply with quote

Code:
if (tclist\='') then
call tclist
Back to top
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 917
Location: The Universe

PostPosted: Tue Jun 27, 2017 3:01 am
Reply with quote

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
View user's profile Send private message
cvnlynn

New User


Joined: 14 Jun 2017
Posts: 31
Location: US

PostPosted: Tue Jun 27, 2017 7:12 am
Reply with quote

TCLIST is the REXX pgm, so does the CALL TCLIST work?
can I use ADDRESS 'ISPEXEC' 'SELECT CMD(%&TCLIST)'
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 712
Location: Denmark

PostPosted: Tue Jun 27, 2017 1:09 pm
Reply with quote

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
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Tue Jun 27, 2017 4:39 pm
Reply with quote

Why not try a little experiment?
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2022
Location: USA

PostPosted: Thu Jun 29, 2017 12:58 am
Reply with quote

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:
Code:
 %&TCLIST
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
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Thu Jun 29, 2017 1:15 am
Reply with quote

I believe that if, e.g., tclist has the value "FOO", then the statement
Code:
call tclist

will be interpreted as
Code:
call FOO

without using the interpret statement.
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 712
Location: Denmark

PostPosted: Thu Jun 29, 2017 2:25 am
Reply with quote

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
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2022
Location: USA

PostPosted: Thu Jun 29, 2017 3:38 am
Reply with quote

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
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 712
Location: Denmark

PostPosted: Thu Jun 29, 2017 2:51 pm
Reply with quote

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
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2022
Location: USA

PostPosted: Thu Jun 29, 2017 11:10 pm
Reply with quote

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
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 712
Location: Denmark

PostPosted: Fri Jun 30, 2017 1:35 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts run rexx code with jcl CLIST & REXX 15
Search our Forums:

Back to Top