Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Convert CLIST to REXX

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: Convert CLIST to REXX
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: 1775
Location: Bloomington, IL

PostPosted: Tue Jun 27, 2017 2:55 am    Post subject:
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: 563
Location: The Universe

PostPosted: Tue Jun 27, 2017 3:01 am    Post subject: Re: Convert CLIST to REXX
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    Post subject:
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 User


Joined: 01 Sep 2015
Posts: 160
Location: Switzerland

PostPosted: Tue Jun 27, 2017 1:09 pm    Post subject:
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: 1868
Location: UK

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

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

Active User


Joined: 29 Apr 2008
Posts: 167
Location: Maryland

PostPosted: Thu Jun 29, 2017 12:58 am    Post subject:
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: 1775
Location: Bloomington, IL

PostPosted: Thu Jun 29, 2017 1:15 am    Post subject:
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 User


Joined: 01 Sep 2015
Posts: 160
Location: Switzerland

PostPosted: Thu Jun 29, 2017 2:25 am    Post subject:
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

Active User


Joined: 29 Apr 2008
Posts: 167
Location: Maryland

PostPosted: Thu Jun 29, 2017 3:38 am    Post subject:
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 User


Joined: 01 Sep 2015
Posts: 160
Location: Switzerland

PostPosted: Thu Jun 29, 2017 2:51 pm    Post subject:
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

Active User


Joined: 29 Apr 2008
Posts: 167
Location: Maryland

PostPosted: Thu Jun 29, 2017 11:10 pm    Post subject:
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 User


Joined: 01 Sep 2015
Posts: 160
Location: Switzerland

PostPosted: Fri Jun 30, 2017 1:35 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts ejck thru rexx to multiple jobs insid... Susanta All Other Mainframe Topics 4 Tue Sep 19, 2017 1:39 pm
This topic is locked: you cannot edit posts or make replies. Extract all "IF" Statements... Adarsh Damodaran CLIST & REXX 1 Wed Sep 06, 2017 9:28 am
No new posts Creating ISPF Screens with Scrname vi... Albireo20 TSO/ISPF 9 Tue Sep 05, 2017 4:24 pm
No new posts Convert rows and column into JSON for... Dinesh Manivannan DB2 2 Sun Sep 03, 2017 6:50 pm
No new posts How to Run Rexx Macro? Kalaivignesh CLIST & REXX 5 Fri Sep 01, 2017 9:08 pm

Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us