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

can you please let me know what this Rexx code does


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

New User


Joined: 30 Sep 2008
Posts: 22
Location: Pune

PostPosted: Tue Jul 14, 2009 7:52 pm
Reply with quote

Rexx Code is :

y = msg('on')
x = outtrap('listcdsn.')
"listc lvl('"lis1"')"
"listc lvl('"lis2"')"
x = outtrap('off')
y = msg('off')
Lis1 and Lis2 are EPF.*.M04 and EPF.*.M05 respectively

Thanks in Advance
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Tue Jul 14, 2009 8:40 pm
Reply with quote

This rexx will execute 2 TSO commands and place the result in a stem variable named "listcdsn."

The 2 commands are:
Code:
LISTCAT LVL('EPF.*.M04')
LISTCAT LVL('EPF.*.M05')
I advise you to execute these commands by yourself to see what the output is.

listcdsn.0 will contain the number of lines in the stem var,
listcdsn.1 to listcdsn.x will contain the output of the commands
(where x is equal to the value of listcdsn.0)

When learning rexx, you should always keep (at least) these 2 books open:
TSO/E Command Reference
REXX Language Reference
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Wed Jul 15, 2009 11:57 am
Reply with quote

Ashish,

In addition to Marso's reply

Quote:
y = msg('on')


MSG is to display/to stop display the messages when the macro runs depending on the value (on or off).

Quote:
x = outtrap('listcdsn.')


OUTTRAP is for trapping the displayed output messages into a stem variable.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Jul 15, 2009 1:47 pm
Reply with quote

Why did you not try it yourself before posting ?
Back to top
View user's profile Send private message
Ashish Mohan Sharma

New User


Joined: 30 Sep 2008
Posts: 22
Location: Pune

PostPosted: Wed Jul 15, 2009 2:25 pm
Reply with quote

Hi Expat,

I dont have authority to run it. I have to decipher the code and document it.


Hi All

Thanks for your reply . It really worked.
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Wed Jul 15, 2009 3:19 pm
Reply with quote

Ashish,

Quote:
I dont have authority to run it.


Agreed. But you can code a new EXEC changing the dataset names and test it. That is the best way to learn icon_biggrin.gif
Back to top
View user's profile Send private message
Ashish Mohan Sharma

New User


Joined: 30 Sep 2008
Posts: 22
Location: Pune

PostPosted: Wed Jul 15, 2009 6:27 pm
Reply with quote

Aaru,

Agreed..... But the problem is this that I have only the view access to the production datasets. And cannot run TSO commands or run jobs.. icon_sad.gif
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Wed Jul 15, 2009 6:49 pm
Reply with quote

Generally speaking, a TSO command encountering a problem will display a message and terminate with a non-zero return code.

For example:

With MSG('ON'), the command "LISTC LVL(EPF.*.M12)" will write 4 lines with messages like "ENTRY EPF.*.M12. NOT FOUND" and return a RC of 4.
With MSG('OFF'), you will have only the RC of 4.

If OUTTRAP is active, the 4 lines will be added to the stem variable or nothing will be added, according to MSG setting.

As you see, you have different ways to get the same result, and you choose which way to use depending on your needs.

Also, it is considered good behavior to "leave the room in the same state as you found it".
To do this, use the following:
Code:
msgstat = MSG('OFF')    /* set msg to off */
    . . .               /* do here what you need to do */
Call MSG(msgstat)       /* restore msg to original state */
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