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
 

 

Reg: Outtrap command execution in batch

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: Reg: Outtrap command execution in batch
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Fri Aug 26, 2011 3:00 pm    Post subject: Reply to: Reg: Outtrap command execution in batch
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: 1738
Location: Bloomington, IL

PostPosted: Fri Aug 26, 2011 3:18 pm    Post subject:
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    Post subject: Reply to: Reg: Outtrap command execution in batch
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    Post subject: Reply to: Reg: Outtrap command execution in batch
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject: Reply to: Reg: Outtrap command execution in batch
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

Moderator Team Head


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

PostPosted: Mon Aug 29, 2011 8:51 pm    Post subject: Re: Reply to: Reg: Outtrap command execution in batch
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    Post subject: Reply to: Reg: Outtrap command execution in batch
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

Moderator Team Head


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

PostPosted: Tue Aug 30, 2011 5:15 pm    Post subject: Reply to: Reg: Outtrap command execution in batch
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    Post subject: Reply to: Reg: Outtrap command execution in batch
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    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 does a called pgm know if its cal... Graeme Westerman COBOL Programming 4 Tue Nov 29, 2016 9:25 pm
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 6 Fri Nov 18, 2016 1:48 pm
This topic is locked: you cannot edit posts or make replies. MIPS reduction for Batch job Virendra Shambharkar All Other Mainframe Topics 8 Mon Nov 07, 2016 4:02 pm
No new posts SDSF Command Avtrix CLIST & REXX 4 Fri Sep 30, 2016 11:13 am
No new posts How to find a CICS resource used in C... Arunkumar Chandrasekaran CICS 8 Thu Sep 29, 2016 1:45 pm


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