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

Reg: Outtrap command execution in batch


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

Active User


Joined: 25 Aug 2007
Posts: 235
Location: Chennai

PostPosted: Fri Aug 26, 2011 11:55 am
Reply with quote

Hi,

I have the following code. It is executing perfectly when i am invoking
directly from TSO. Ie (after execution found =1) But when i am submitting this from batch JCL not getting exected results. (ie found = 0)

Will outtrap command execute while executing from batch JCL?

Code:

DMY=OUTTRAP("LOADLINES.","*")                   
ADDRESS TSO                                     
"PRINT IDS('TEST.SDR.LOADLIB(TESTPGM)') CHAR"
DMY = OUTTRAP("OFF")                             
FOUND=0                                         
DO K= 1 TO 2                                     
   IF POS('ZEPF',LOADLINES.K) > 0 THEN DO   
      FOUND=1                                   
      LEAVE                                     
   END                                           
END                                             


Please share your thoughts.

Thanks in advance
R KARTHIK
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Aug 26, 2011 3:00 pm
Reply with quote

Have you done any investigation yourself?

You have run OUTTRAP. Surely you now know whether it executes or not?

Why don't you get a little bit of code to show you what (if anything) exists in LOADLINES? What are the values you get in DMY at the relevant points?
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Fri Aug 26, 2011 3:18 pm
Reply with quote

You are running your exec in batch in background TSO (PGM=IKJEFT01, not PGM=IRXJCL), yes?
Back to top
View user's profile Send private message
karthikr44

Active User


Joined: 25 Aug 2007
Posts: 235
Location: Chennai

PostPosted: Fri Aug 26, 2011 5:57 pm
Reply with quote

HI,

Yes Akatsukami. I am running this code through PGM=IKJEFT01.

Since this dataset is in undefined format, i am using Outtrap and PRINT IDS command. I cant use EXECIO command.

Please let me know any alternative way.

Thanks
R KARTHIK
Back to top
View user's profile Send private message
karthikr44

Active User


Joined: 25 Aug 2007
Posts: 235
Location: Chennai

PostPosted: Fri Aug 26, 2011 6:46 pm
Reply with quote

HI,

I am doing some investigation between both execution. Will post you the updates soon.

Thanks
R KARTHIK
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Aug 26, 2011 6:47 pm
Reply with quote

Quote:
But when i am submitting this from batch JCL not getting (sic) exected results. (ie found = 0)


not bothering to go into the necessary libraries you need,
why don't you think found=1?

how are you seeing the results?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Aug 26, 2011 7:51 pm
Reply with quote

you can do this with LMM routines,
which would save you memory in the event one of these load members is reallllllllllly big,
but otherwise OUTTRAPing the print, or a variation of that is probably easier,
coding-wise.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Aug 26, 2011 8:06 pm
Reply with quote

to get around the file size problem,
since you are only processing 2 records anyway

actually you are only processing 1 record from the testpgm file.
the first item in your stem is
Code:

RECORD SEQUENCE NUMBER - 1


so modify your print command as follows:
Code:

"PRINT IDS('TEST.SDR.LOADLIB(TESTPGM)') COUNT(1) CHAR"


then instead of looping, you only need to address the 2 stem item
to see if your POS('ZEPF',LOADLINES.K) is > 0.
Back to top
View user's profile Send private message
karthikr44

Active User


Joined: 25 Aug 2007
Posts: 235
Location: Chennai

PostPosted: Mon Aug 29, 2011 8:46 pm
Reply with quote

HI ALL,

I found the problem. Before outtrap command i am using the following code to copy the member of PDS.

Code:

"ISPEXEC LMINIT DATAID(FROMDD) DATASET('PROD.LOADLIB')"                     
"ISPEXEC LMINIT DATAID(BKPDD) DATASET('TEST.SDR.LOADLIB')",     
" ENQ(EXCLU)"                                                       
"ISPEXEC LMCOPY FROMID(&FROMDD) FROMMEM(YRFTGU01) TOMEM(TESTPGM)
" REPLACE TODATAID(&BKPDD)"                                               
"ISPEXEC LMFREE DATAID("BKPDD")"                                     
"ISPEXEC LMFREE DATAID("FROMDD")"                                   


When i am invoking directly from TSO, new member YRFTGU01 is copied to TESTPGM.
But when i am submitting in batch thru IKJEFT01, new member YRFTGU01 is not copied to TESTPGM.

Will LMM service not work when submitting thru batch? Is there any alternative to copy the member from PDS.

Thanks
R KARTHIK
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Mon Aug 29, 2011 8:51 pm
Reply with quote

karthikr44 wrote:
Will LMM service not work when submitting thru batch?


ISPF Services work just fine if you remember to start ISPF and if you've provided all of the necessary ISPF libraries to that job step.

karthikr44 wrote:
Is there any alternative to copy the member from PDS


What's wrong with a good old-fashioned IEBCOPY step?
Back to top
View user's profile Send private message
karthikr44

Active User


Joined: 25 Aug 2007
Posts: 235
Location: Chennai

PostPosted: Tue Aug 30, 2011 3:19 pm
Reply with quote

HI Superk,

Thanks for your reply. I tried giving ISPF libs which i picked from LOGON jcl. Still LMM service not working. Is there any standard IBM library for ISPF service.

If it is possible can you please suggest how to use IEBCOPY in rexx. I searched in forums. But not getting how to use that.

Thanks
R KARTHIK
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Tue Aug 30, 2011 5:15 pm
Reply with quote

Try the free ISPF Edit Macro utility BATCHPDF which will create a batch equivalent to your TSO and ISPF session. You can tweak the results from there however you please.

You can use IEBCOPY like you use any utility or program in TSO. You allocate the necessary DD statements and you call it. Seriously, do you not know how to run programs in TSO? A quick review:

Code:

/* REXX */
...
"ALLOC F(ddname) DA(.....)"
"ALLOC F(SYSIN) NEW REU RECFM(F B) LRECL(80) UNIT(VIO) SPACE(1,1) CYLINDERS"
Queue "your sysin parameters"
"EXECIO "Queued()" DISKW sysin (FINIS"
"CALL *(IEBCOPY)"
"FREE F(ddname .... SYSIN)"
...
Back to top
View user's profile Send private message
karthikr44

Active User


Joined: 25 Aug 2007
Posts: 235
Location: Chennai

PostPosted: Wed Aug 31, 2011 12:24 pm
Reply with quote

HI Kevin,

Thanks for your reply.

I coded IEBCOPY in REXX. It is working perfectly as expected.

Code:

"ALLOC F(SYSUT1) DS('PROD.LOADLIB')                                 
 SHR REUSE"                                                 
"ALLOC F(SYSUT2) DS('TEST.SDR.LOADLIB')                 
 SHR REUSE"                                                 
"ALLOC F(SYSPRINT) SYSOUT REUSE"                           
"ALLOC F(SYSIN) UNIT(SYSDA) SPACE(1 1) TRACKS REUSE"       
SYSIN.0 = 2                                                 
SYSIN.1 = "  C I=SYSUT1,O=SYSUT2"                           
SYSIN.2 = "  SELECT MEMBER=((DRDED022,TESTPGM,R))"     
"EXECIO * DISKW SYSIN (FINIS STEM SYSIN."                   
DROP SYSIN.                                                 
"CALL *(IEBCOPY)"                                           
"FREE F(SYSUT1 SYSUT2 SYSPRINT SYSIN)"                     


Thanks all for your suggestions.
R KARTHIK
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 RACF - Rebuild SETROPTS command which... All Other Mainframe Topics 3
No new posts Routing command Address SDSF to other... TSO/ISPF 2
No new posts DTL - how to define key with stacked ... TSO/ISPF 3
No new posts How to get a stack trace on a looping... ABENDS & Debugging 5
No new posts LTJ command CA Products 4
Search our Forums:

Back to Top