Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
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
 
Why do we use Outtrap for in the following code?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
surya.kalyan

New User


Joined: 09 Jan 2007
Posts: 20
Location: Mumbai

PostPosted: Wed Jul 02, 2008 4:12 pm    Post subject: Why do we use Outtrap for in the following code?
Reply with quote

Code:

/*REXX*/                                         
INPUT  = 'T.TCS.CR.KALYAN.TEMP'                 
            X = OUTTRAP(MEMS.)                   
/* TO GET THE MEMBER LIST FROM THE INPUT PDS */ 
            "LISTDS '"INPUT"' MEM"               
            X = OUTTRAP(OFF)                     
DO I=7 TO MEMS.0                                 
      MEMS.I = STRIP(MEMS.I)                     
       SAY 'MEMBER:'MEMS.I                       
END                                             
EXIT                                             


In the above code mentioned which lists the members of a PDS, Can any one explain me why we use OUTTRAP for??

I did a QW but failed to understand the exact reason.
Back to top
View user's profile Send private message

PeD

Active User


Joined: 26 Nov 2005
Posts: 456
Location: Belgium

PostPosted: Wed Jul 02, 2008 4:24 pm    Post subject:
Reply with quote

To avoid receiving all superfluous messages from LISTDS and to be able to process the stem
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4650
Location: Raleigh, NC, USA

PostPosted: Wed Jul 02, 2008 4:38 pm    Post subject: Reply to: Why do we use Outtrap for in the following code?
Reply with quote

A few notes about OUTTRAP:
Quote:

In general, the OUTTRAP function traps all output from a TSO/E command. For example, OUTTRAP traps broadcast messages from LISTBC, the list of allocated data sets from LISTALC, catalog entries from LISTCAT, and so on.

If you plan to write your own command processors for use in REXX execs, and you plan to use the OUTTRAP external function to trap command output, note the OUTTRAP function does not trap command output that is sent to the terminal by:

TPUT
WTO macro
messages issued by TSO/E REXX (that is, messages beginning with IRX)
messages issued by TRACE output

However, OUTTRAP does trap output from the PUTLINE macro with DATA or INFOR keywords.
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1243
Location: Israel

PostPosted: Wed Jul 02, 2008 4:39 pm    Post subject:
Reply with quote

Just try without the OUTTRAP: the output of the LISTDS command will be displayed on your screen, and your REXX program will have no idea of what the result was.

OUTTRAP will just do what it says: it TRAPS the OUTput from TSO commands and make it available to the REXX program.
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 Speed-up/reduce CPU use of code prino PL/I & Assembler 0 Tue Sep 26, 2017 12:05 am
This topic is locked: you cannot edit posts or make replies. how to code for GDG in Rexx cvnlynn CLIST & REXX 13 Wed Aug 09, 2017 9:13 pm
This topic is locked: you cannot edit posts or make replies. rexx code to create a ps file Bharath Vikraman CLIST & REXX 4 Mon Aug 07, 2017 10:30 am
No new posts I want to retire TRX and use only Rex... Abhinav Sharma CLIST & REXX 6 Sat Jul 29, 2017 2:53 am
No new posts UNIT=AFF for Easytrieve code gandikk JCL & VSAM 7 Wed Jul 12, 2017 11:42 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us