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
 

 

Finding difficulty in using OUTTRAP function

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: Finding difficulty in using OUTTRAP function
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: 2150
Location: At my coffee table

PostPosted: Wed Mar 31, 2010 1:51 am    Post subject:
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    Post subject: Reply
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

Senior Member


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

PostPosted: Wed Mar 31, 2010 4:06 am    Post subject: Reply to: Finding difficulty in using OUTTRAP function
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: 2150
Location: At my coffee table

PostPosted: Wed Mar 31, 2010 4:29 am    Post subject: Re: Reply to: Finding difficulty in using OUTTRAP function
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

Senior Member


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

PostPosted: Wed Mar 31, 2010 5:01 am    Post subject: Reply to: Finding difficulty in using OUTTRAP function
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: 401
Location: Mumbai

PostPosted: Wed Mar 31, 2010 5:22 am    Post subject: Reply to: Finding difficulty in using OUTTRAP function
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: 2150
Location: At my coffee table

PostPosted: Wed Mar 31, 2010 5:23 am    Post subject: Re: Reply to: Finding difficulty in using OUTTRAP function
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

Moderator Team Head


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

PostPosted: Wed Mar 31, 2010 6:37 am    Post subject: Reply to: Finding difficulty in using OUTTRAP function
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: 2150
Location: At my coffee table

PostPosted: Wed Mar 31, 2010 7:23 am    Post subject:
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: 1703
Location: Australia

PostPosted: Wed Mar 31, 2010 10:04 am    Post subject:
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    Post subject: Thank you all
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

Senior Member


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

PostPosted: Wed Mar 31, 2010 9:01 pm    Post subject: Re: Thank you all
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Wed Mar 31, 2010 9:27 pm    Post subject: Reply to: Finding difficulty in using OUTTRAP function
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

Senior Member


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

PostPosted: Wed Mar 31, 2010 9:46 pm    Post subject: Reply to: Finding difficulty in using OUTTRAP function
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

Site Director


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

PostPosted: Thu Apr 01, 2010 12:08 am    Post subject: Reply to: Finding difficulty in using OUTTRAP function
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: 401
Location: Mumbai

PostPosted: Thu Apr 01, 2010 9:29 am    Post subject:
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    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
This topic is locked: you cannot edit posts or make replies. RANDOM Function in COBOL swapnil781 COBOL Programming 2 Tue Nov 15, 2016 6:17 pm
No new posts Check System time(Minute) Using TIME1... balaji81_k DFSORT/ICETOOL 5 Fri Nov 11, 2016 10:53 am
No new posts Strange EXEC function call in z/VM Willy Jensen CLIST & REXX 3 Wed Oct 05, 2016 2:07 pm
No new posts Replace function abdulrafi COBOL Programming 13 Mon Sep 12, 2016 10:12 am
No new posts Which function does the Ampersand (&a... Andi1982 PL/I & Assembler 3 Wed Aug 24, 2016 2:05 pm


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