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 Usergroups Profile Log in to check your private messages Log in
 

 

can you please let me know what this Rexx code does

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: can you please let me know what this Rexx code does
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: 1224
Location: Israel

PostPosted: Tue Jul 14, 2009 8:40 pm    Post subject:
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: 1288
Location: Chennai, India

PostPosted: Wed Jul 15, 2009 11:57 am    Post subject: Reply to: can you please let me know what this Rexx code doe
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: 8593
Location: Back in jolly old England

PostPosted: Wed Jul 15, 2009 1:47 pm    Post subject:
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    Post subject:
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: 1288
Location: Chennai, India

PostPosted: Wed Jul 15, 2009 3:19 pm    Post subject: Reply to: can you please let me know what this Rexx code doe
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    Post subject:
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: 1224
Location: Israel

PostPosted: Wed Jul 15, 2009 6:49 pm    Post subject: Reply to: can you please let me know what this Rexx code doe
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    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 How to Capture the Max return code of... anilkumar922 All Other Mainframe Topics 0 Thu Jan 12, 2017 12:02 pm
This topic is locked: you cannot edit posts or make replies. Calling REXX code from ISPF panel sanchita dey TSO/ISPF 4 Mon Jan 02, 2017 5:13 pm
No new posts REXX DB2: Dynamic allocation of DB2.D... BHAS CLIST & REXX 3 Mon Dec 19, 2016 8:26 pm
No new posts find particular member name in PDS us... ravi243 CLIST & REXX 10 Mon Dec 19, 2016 6:44 pm
No new posts PL/I code tuning/Performance improvement Virendra Shambharkar PL/I & Assembler 4 Mon Dec 05, 2016 11:57 am


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