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

Finding difficulty in using OUTTRAP function


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

New User


Joined: 22 Mar 2010
Posts: 17
Location: Hartford

PostPosted: Wed Mar 31, 2010 1:42 am
Reply with quote

Hi,

I have used OUTTRAP function in my REXX routine.Its working fine when iam executing it directly.How ever when iam trying to execute the routine using a JCL i couldn't execte it iam getting the below error.

9 +++ A = OUTTRAP('MEM.')
IRX0043I Error running REXXRTN1, line 9: Routine not found

I have executed using IRXJCL and passing the member name in parm parameter.

I have mentioned in the REXX routine ADDRESS MVS..

Please let me know if we can use OUTTRAP in MVS environment

Thank You,
Kranthi
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Wed Mar 31, 2010 1:51 am
Reply with quote

Does your JCL have a DD pointing to the PDS containing 'MEM.'?
Back to top
View user's profile Send private message
Kranthi_Merigala

New User


Joined: 22 Mar 2010
Posts: 17
Location: Hartford

PostPosted: Wed Mar 31, 2010 2:04 am
Reply with quote

My JCL

JCL:

Code:
//REXXSTEP EXEC PGM=IRXJCL,PARM='REXXRTN1'     
//SYSEXEC  DD DSN=GTS.G412.REXX.RTN,DISP=SHR   
//SYSTSPRT DD SYSOUT=*                         
//SYSPRINT DD SYSOUT=*                         
//SYSOUT   DD SYSOUT=T                         
//SYSUDUMP DD SYSOUT=T                         
//SYSTSIN  DD *                               
 GGP0                                         
/*                                 


Rexx routine

Code:
/********************REXX**************/                               
ADDRESS MVS                                                           
SAY 'ENTER PGM NAME OR THE INITIAL LETTERS OF PGMS TO BE SEARCHED'     
PARSE PULL D1                                                         
NUM = WORDLENGTH(D1,1)                                                 
PDS = GTS.CCD.G412.COBOL                                               
ADDRESS TSO                                                           
A = OUTTRAP(MEM.)                                                     
"LISTDS '"PDS"' MEMBERS"                                               
A = OUTTRAP('OFF')                                                     
Z = 1                                                                 
DO I = 1 TO MEM.0                                                     
   IF SUBSTR(MEM.I,1,NUM+2) = D1 THEN                                 
      DO                                                               
        PDS1 = PDS || '(' || STRIP(MEM.I) || ')'                       
        "ALLOC DA('"PDS1"') F(INDD) SHR REUSE"                         
        "EXECIO * DISKR INDD (STEM VAR1. FINIS"                       
              "FREE F(INDD)"
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2546
Location: Silicon Valley

PostPosted: Wed Mar 31, 2010 4:06 am
Reply with quote

Quote:
line 9: Routine not found

What is on line 9?

Better yet, what is on line 10?
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Wed Mar 31, 2010 4:29 am
Reply with quote

Pedro wrote:
Better yet, what is on line 10?
Sorry, but wrong question....buzzzzz....icon_redface.gif
Kranthi_Merigala wrote:
9 +++ A = OUTTRAP('MEM.')
IRX0043I Error running REXXRTN1, line 9: Routine not found
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2546
Location: Silicon Valley

PostPosted: Wed Mar 31, 2010 5:01 am
Reply with quote

He is trying to trap the output from a TSO command in a non-TSO environment.

The command is in line 10.

Also, I question what is there because his trace does not match the program he posted.
Back to top
View user's profile Send private message
MBabu

Active User


Joined: 03 Aug 2008
Posts: 400
Location: Mumbai

PostPosted: Wed Mar 31, 2010 5:22 am
Reply with quote

Ikjeft01 is TSO. Use that instead of irxjcl.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Wed Mar 31, 2010 5:23 am
Reply with quote

Pedro wrote:
He is trying to trap the output from a TSO command in a non-TSO environment.
That might explain it....
Quote:
The command is in line 10.
Code:
1 p-ADDRESS MVS                                                           
2 SAY 'ENTER PGM NAME OR THE INITIAL LETTERS OF PGMS TO BE SEARCHED'     
3 PARSE PULL D1                                                         
4 NUM = WORDLENGTH(D1,1)                                                 
5 PDS = GTS.CCD.G412.COBOL                                               
6 ADDRESS TSO                                                           
7 A = OUTTRAP(MEM.)                                                     
8 "LISTDS '"PDS"' MEMBERS"                                               
9 A = OUTTRAP('OFF')                                                     
10 Z = 1       
His line 9 or your line 10 or this line 7???????
Quote:
Also, I question what is there because his trace does not match the program he posted.
That might be why you can answer these questions more intelligently than I... you are a better man than I, Gunga Din...grin...
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Wed Mar 31, 2010 6:37 am
Reply with quote

From the documentation:

You can use the OUTTRAP function only in REXX execs that run in the TSO/E address space.

Not to mention that LISTDS is a TSO command.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Wed Mar 31, 2010 7:23 am
Reply with quote

Quote:
You can use the OUTTRAP function only in REXX execs that run in the TSO/E address space.
Dang, you are good. I knew there was a reason we named you "Moderator Team Head"....grin.....
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Wed Mar 31, 2010 10:04 am
Reply with quote

Hi,

If I'm off the rail, please ignore.

I hacked this from an old archived file I had

Code:
//ST01GEN  EXEC PGM=IEBGENER                 
//SYSPRINT DD SYSOUT=*                       
//SYSIN    DD DUMMY                           
//SYSUT2   DD DSN=&&SYSPROC(REXXRTN1),       
//            DISP=(,PASS),                   
//            UNIT=VIO,                       
//            SPACE=(TRK,(1,1,1)),           
//            DCB=(RECFM=FB,LRECL=80)         
//SYSUT1   DD *,DLM='$$'                     
/*  REXX EXEC  */                             
  TRACE R                                     
ARG PARMINFO                                 
PARSE VAR PARMINFO D1                         
NUM = WORDLENGTH(D1,1)   
PDS = GTS.CCD.G412.COBOL                                                               
X = OUTTRAP('MEM.')                           
"LISTDS '"PDS"' MEMBERS"                     
X = OUTTRAP('OFF')                           
                           
DO I = 7 TO MEM.0                                                       
   IF SUBSTR(MEM.I,1,NUM+2) = D1 THEN                                   
      DO                                                               
        PDS1 = PDS || '(' || STRIP(MEM.I) || ')'                       
        "ALLOC DA('"PDS1"') F(INDD) SHR REUSE"                         
        "EXECIO * DISKR INDD (STEM VAR1. FINIS"                         
              "FREE F(INDD)"                                           
END                                                                     
END                                                                     
$$                                                                     
//*                                                                     
//**********************************************************************
//*                                                                     
//ST02REXX EXEC PGM=IKJEFT01,DYNAMNBR=50,COND=(0,LT),                   
//   PARM=('REXXRTN1  GGP0')                                               
//SYSPROC  DD DSN=&&SYSPROC,DISP=(OLD,DELETE)                           
//SYSTSPRT DD SYSOUT=*                                                 
//SYSPRINT DD SYSOUT=*,OUTLIM=999999                                   
//SYSOUT   DD SYSOUT=*                                                 
//SYSTSIN  DD DUMMY                                                     
//*                                                                     


Gerry
Back to top
View user's profile Send private message
Kranthi_Merigala

New User


Joined: 22 Mar 2010
Posts: 17
Location: Hartford

PostPosted: Wed Mar 31, 2010 8:09 pm
Reply with quote

Thank you so much its working with IKJEFT01 and
ARG PARMINFO
PARSE VAR PARMINFO D1

So finally we can conclude OUTTRAP can be used while executing rexx thru JCL
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Wed Mar 31, 2010 9:01 pm
Reply with quote

I don't speak REXX much, but this was not so tricky to understand. (Though I may be wrong)

Kevin said, "You can use the OUTTRAP function only in REXX execs that run in the TSO/E address space. "

So you can not conlude this
Quote:
So finally we can conclude OUTTRAP can be used while executing rexx thru JCL
- JCL from Gerry executes IKJEFT01, TSO in batch, in other words - you're using OUTTRAP in TSO/E address space.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Wed Mar 31, 2010 9:27 pm
Reply with quote

as usual we face the usual language barrier and/or the usual JCL misunderstanding

execute by JCL means absolutely nothing
JCL is the operating system facility which setups things for program execution

technically speaking also a tso session is JCL started icon_wink.gif
interpreter/converter and all that
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2546
Location: Silicon Valley

PostPosted: Wed Mar 31, 2010 9:46 pm
Reply with quote

Quote:
You can use the OUTTRAP function only in REXX execs that run in the TSO/E address space.


BTW, this is clearly stated in the manual. It is not clear why the poster did not look there first.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Apr 01, 2010 12:08 am
Reply with quote

Quote:
It is not clear why the poster did not look there first.
As with many "projects" - if all else fails, read the directions. . . icon_smile.gif
Back to top
View user's profile Send private message
MBabu

Active User


Joined: 03 Aug 2008
Posts: 400
Location: Mumbai

PostPosted: Thu Apr 01, 2010 9:29 am
Reply with quote

Not to hijack this thread (ok, sorry) but lets be straight about the fact that IBM documentation is not the easiest thing to wade through (and I've written my fair share of it).

I'm a big fan of BookManager for its searches since it was putting what you want at the top of the search results years before Google ever existed, but most manuals are very hard to read online because each page is a tiny sliver of the book, sometimes even just one sentence per page! And those pages that do have extensive information assume you already know everything else about terminology, system architecture, system components and configuration... everything there is to know except what is on that one page -- no links, no references. And now that BookManager seems to be giving way to Eclipse based 'infocenters' which have really, really bad search engines and slow, non-intuitive UIs, searching for information in IBM doc is getting harder and harder. I'm not surprised that people don't read the doc. I'm not proud of it, but I go to the manuals only as a last resort. I ask, I experiment, I hack code before I go to the books. Its just too painful. (If I have a hardcopy, it is the 1st place I go because most manuals work well in hardcopy format).

In this case, Google of 'outtrap' turns up the answer on the very first hit, but even that sentence is confusing: "The OUTTRAP function can be used only in REXX execs that run in the TSO/E address space." What, there is only one?
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 VB to FB - Finding LRECL SYNCSORT 4
No new posts Calling an Open C library function in... CICS 1
No new posts DATE2 function SYNCSORT 15
No new posts Help on PL/I jsonPutValue function PL/I & Assembler 8
No new posts how to use Tso outtrap external function All Other Mainframe Topics 8
Search our Forums:

Back to Top