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

XDC using REXX... Facing problem.. pleaase guide


IBM Mainframe Forums -> CLIST & REXX
Post new topic   This topic is locked: you cannot edit posts or make replies.
View previous topic :: View next topic  
Author Message
seshagiri.N
Warnings : 1

New User


Joined: 05 Aug 2008
Posts: 16
Location: India

PostPosted: Wed Aug 13, 2008 8:15 am
Reply with quote

Hello all,
I am trying to write a REXX tool to copy the job from spool to PDS.i.e, XDC. i have written the following code:

Code:

/*****************************REXX************************************/
/*TRACE ?R*/                                                           
ADDRESS TSO                                                             
"ALLOC F(ISFIN) TRACKS SPACE(1) REU" /* USED BY SDSF */                 
"ALLOC F(ISFOUT) NEW DELETE REU " , /* USED BY SDSF */                 
"TRACKS SPACE(100,100) LRECL(133) RECFM(F,B,A) DSORG(PS)"               
"ALLOC F(TEMPPRT) DA('NBDKYGS.REXX.JOB2') SHR"                         
JOBID = "JOB02743"                                                     
QUEUE "PRE NBDKYGS2" /* SDSF COMMANDS IN BATCH*/                       
QUEUE "ST"                                                             
QUEUE "FILTER JOBNAME " JOBID                                           
QUEUE "++S"                                                             
QUEUE "PRINT FILE TEMPPRT" /* PRINT TO TEMP DATASET */                 
QUEUE "PRINT 1 999999"                                                 
QUEUE "PRINT CLOSE"                                                     
QUEUE "END"                                                             
QUEUE "EXIT"                                                           
"EXECIO" QUEUED()" DISKW ISFIN (FINIS" /* INPUT TO SDSF BATCH */       
ADDRESS ISPEXEC "SELECT PGM(ISFAFD) PARM('++25,80')"/* INVOKE SDSF */
EXIT                                                                                         


Here i am able to create a PS and XDC the job with job a perticular job ID to it. Now ...

1> What should I do to copy / XDC to PDS member not a PS?
2> I am getting the data in the file(PS) something like this:
Code:

1                     J E S 2  J O B  L O G  --  S Y S T E M  1 M 0 1  --  N O D
0                                                                               
 04.47.19 JOB02051 ---- TUESDAY,   12 AUG 2008 ----                             



Code:
1 HQX7730 -----------------  SDSF PRIMARY OPTION MENU  -------------------------
  COMMAND INPUT ===>                                            SCROLL ===> PAGE
                                                                               
  DA    Active users                      INIT  Initiators                     
  I     Input queue                       PR    Printers                       
  O     Output queue                      PUN   Punches                         
  H     Held output queue                 RDR   Readers                         
  ST    Status of jobs                    LINE  Lines                           
                                          NODE  Nodes                           
  LOG   System log                        SO    Spool offload                   
  SR    System requests                   SP    Spool volumes                   
  MAS   Members in the MAS                                                     
  JC    Job classes                       ULOG  User session log               
  SE    Scheduling environments                                                 
  RES   WLM resources                                                           
  ENC   Enclaves                                                               
  PS    Processes                                                               
                                                                               
  END   Exit SDSF                                                               
                                                                               
  Licensed Materials - Property of IBM                                         
                                                                               
  5694-A01 (C) Copyright IBM Corp. 1981, 2006. All rights reserved.             
  US Government Users Restricted Rights - Use, duplication or                   
  disclosure restricted by GSA ADP Schedule Contract with IBM Corp.             
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               
1 HQX7730 -----------------  SDSF PRIMARY OPTION MENU  -------------------------
  COMMAND INPUT ===>                                            SCROLL ===> PAGE
                                                                               
  DA    Active users                      INIT  Initiators                     
  I     Input queue                       PR    Printers                       
  O     Output queue                      PUN   Punches                         
  H     Held output queue                 RDR   Readers                         
  ST    Status of jobs                    LINE  Lines                           
                                         NODE  Nodes                           
 LOG   System log                        SO    Spool offload                   
 SR    System requests                   SP    Spool volumes                   
 MAS   Members in the MAS                                                     
 JC    Job classes                       ULOG  User session log               
 SE    Scheduling environments                                                 
 RES   WLM resources                                                           
 ENC   Enclaves                                                               
 PS    Processes                                                               
                                                                               
 END   Exit SDSF                                                               
1 SDSF STATUS DISPLAY ALL CLASSES                        LINE 0-0 (0)           
  COMMAND INPUT ===>                                            SCROLL ===> PAGE
  NP   JOBNAME  TYPE  JNUM  QUEUE      DEST     SAFF  ST-TIME  ST-DATE TOT-LINES
                                                                               
                                                                               
                                                                               
1 SDSF STATUS DISPLAY ALL CLASSES                        LINE 0-0 (0)           
  COMMAND INPUT ===>                                            SCROLL ===> PAGE
  NP   JOBNAME  TYPE  JNUM  QUEUE      DEST     SAFF  ST-TIME  ST-DATE TOT-LINES
1 SDSF STATUS DISPLAY ALL CLASSES                         INVALID COMMAND       
  COMMAND INPUT ===> ++?                                        SCROLL ===> PAGE
  NP   JOBNAME  TYPE  JNUM  QUEUE      DEST     SAFF  ST-TIME  ST-DATE TOT-LINES
                                                                               
                                                                               
                                                                               
                                                                               
1 SDSF STATUS DISPLAY ALL CLASSES                        NO CHARS 'MSGUSR' FOUND
  COMMAND INPUT ===>                                            SCROLL ===> PAGE
  NP   JOBNAME  TYPE  JNUM  QUEUE      DEST     SAFF  ST-TIME  ST-DATE TOT-LINES
                                                                               
                                                                               
                                                                               
                                                                               
1 SDSF STATUS DISPLAY ALL CLASSES                         INVALID COMMAND       
  COMMAND INPUT ===> ++S                                        SCROLL ===> PAGE
  NP   JOBNAME  TYPE  JNUM  QUEUE      DEST     SAFF  ST-TIME  ST-DATE TOT-LINES
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               
1 SDSF STATUS DISPLAY ALL CLASSES                        LOCATE ERROR  8 0000000
  COMMAND INPUT ===> PRINT ODSN 'NBDKYGS.REXX.XDCDSN' * SHR     SCROLL ===> PAGE
   **** DATA SET NOT CATALOGED  DSNAME=NBDKYGS.REXX.XDCDSN                     
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               
1 SDSF STATUS DISPLAY ALL CLASSES                         PARM INVALID         
  COMMAND INPUT ===> PRINT 1 9999                               SCROLL ===> PAGE
   **** DATA SET NOT CATALOGED  DSNAME=NBDKYGS.REXX.XDCDSN                     
                                                                               
                                                                               
                                                                               
                                                                               
1 SDSF STATUS DISPLAY ALL CLASSES                         PRINT NOT OPENED     
  COMMAND INPUT ===> PRINT CLOSE                                SCROLL ===> PAGE
   **** DATA SET NOT CATALOGED  DSNAME=NBDKYGS.REXX.XDCDSN                     
                                                                               
                                                                               
                                                                               
1 HQX7730 -----------------  SDSF PRIMARY OPTION MENU  -------------------------
  COMMAND INPUT ===>                                            SCROLL ===> PAGE
                                                                               
  DA    Active users                      INIT  Initiators                     
  I     Input queue                       PR    Printers                       
  O     Output queue                      PUN   Punches                         
  H     Held output queue                 RDR   Readers                         
  ST    Status of jobs                    LINE  Lines                           
                                          NODE  Nodes                           
  LOG   System log                        SO    Spool offload                   
  SR    System requests                   SP    Spool volumes                   
  MAS   Members in the MAS                                                     
  JC    Job classes                       ULOG  User session log               
  SE    Scheduling environments                                                 
  RES   WLM resources                                                           
  ENC   Enclaves                                                               
  PS    Processes                                                               
  END   Exit SDSF                                                               
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               
1 HQX7730 -----------------  SDSF PRIMARY OPTION MENU     INVALID COMMAND       
  COMMAND INPUT ===> EXIT                                       SCROLL ===> PAGE
                                                                               
  DA    Active users                      INIT  Initiators                     
  I     Input queue                       PR    Printers                       
  O     Output queue                      PUN   Punches                         
  H     Held output queue                 RDR   Readers                         
ST    Status of jobs                    LINE  Lines                           
                                        NODE  Nodes                           
LOG   System log                        SO    Spool offload                   
SR    System requests                   SP    Spool volumes                   
MAS   Members in the MAS                                                     
JC    Job classes                       ULOG  User session log               
SE    Scheduling environments                                                 
RES   WLM resources                                                           
ENC   Enclaves                                                               
PS    Processes                                                               
                                                                             
END   Exit SDSF                                                       



and so on....

I want only the the below one in my output:
Code:

1                     J E S 2  J O B  L O G  --  S Y S T E M  1 M 0 1  --  N O D
0                                                                               
 04.47.19 JOB02051 ---- TUESDAY,   12 AUG 2008 ----                             


----- JoB LOG---------

How can i accomplish this?
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Wed Aug 13, 2008 11:27 am
Reply with quote

seshagiri,

Quote:
1> What should I do to copy / XDC to PDS member not a PS?


Allocate a PDS and not a PS. Change the following code.

Code:
"ALLOC F(ISFOUT) NEW DELETE REU " , /* USED BY SDSF */                 
"TRACKS SPACE(100,100) LRECL(133) RECFM(F,B,A) DSORG(PS)"


to something like

Code:
ADDRESS "TSO"
"ALLOC DSN('"yourdataset"') NEW SPACE (50 20) CYL DIR(10)"




Quote:
I want only the the below one in my output:


Once you got the data XDC'ed to your output file, you need to read that file and process it according to your reqts.
Back to top
View user's profile Send private message
seshagiri.N
Warnings : 1

New User


Joined: 05 Aug 2008
Posts: 16
Location: India

PostPosted: Wed Aug 13, 2008 1:09 pm
Reply with quote

Thank you very much. I got it in a PDS. For the first time when i execute the REXX.. it created a new PDS and added a member to it with the output i need.
Code:

"ALLOC F(TEMPPRT) DA('NBDKYGS.REXX.JOB2(OUT1)')     
           NEW SPACE (50 20) CYL DIR(10)"           



when i ran the 2nd time with different member name for the same PDS.

i.e., I used the code

Code:

"ALLOC F(TEMPPRT) DA('NBDKYGS.REXX.JOB2(OUT2)')     
           NEW SPACE (50 20) CYL DIR(10)"           



I got the error something like:

File not allocated NBDKYGS.REXX.JOB2. File in use

How can i get another member to the same PDS?
Back to top
View user's profile Send private message
seshagiri.N
Warnings : 1

New User


Joined: 05 Aug 2008
Posts: 16
Location: India

PostPosted: Wed Aug 13, 2008 1:16 pm
Reply with quote

oops! icon_smile.gif I did a mistake. I got the result.
Thank you! icon_biggrin.gif
Back to top
View user's profile Send private message
seshagiri.N
Warnings : 1

New User


Joined: 05 Aug 2008
Posts: 16
Location: India

PostPosted: Wed Aug 13, 2008 1:21 pm
Reply with quote

If i invoke this REXX code from a JCL and I want to copy the details of the same JOB(currently running). Can this be possible? If so how?
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Aug 13, 2008 3:50 pm
Reply with quote

If you use DA instead of ST in the SDSF code, then you do not need to know the job number, so can select on the currently running job.

You can even put the code inside of the same job, as only one job with that name can run at any one time, so you get the right job.
Back to top
View user's profile Send private message
seshagiri.N
Warnings : 1

New User


Joined: 05 Aug 2008
Posts: 16
Location: India

PostPosted: Wed Aug 13, 2008 4:08 pm
Reply with quote

Thanks for your responce!
I have changed ST to DA and tried.
I tried to execute REXX in JCL as below:
Code:

.....JOB CARD......
//TSOBATCH EXEC PGM=IKJEFT1A,DYNAMNBR=200   
//SYSEXEC DD DSN=NBDKYGS.REXX.EXEC,DISP=SHR 
//SYSPRINT DD SYSOUT=*                       
//SYSTSPRT DD SYSOUT=*                       
//SYSTSIN DD *     
EXEC1             
/*                 


but i got the output as below:

Code:
1READY                                                                         
 EXEC1                                                                         
     25 *-* ADDRESS ISPEXEC "SELECT PGM(ISFAFD) PARM('++25,80')"/* INVOKE SDSF */
        +++ RC(-3) +++                                                         
 READY                                                                         
 END       


I am unable to resolve the problem was. please tell me wher i did the mistake and how to resolve.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Aug 13, 2008 4:11 pm
Reply with quote

You need to be running in an ISPF environment rather than native TSO. Allocate all of the ISPF libraries and DD names that are currently allocated to you TSO session (use TSO ISRDDN ) to find them. They are the libraries that begin ISP
Back to top
View user's profile Send private message
seshagiri.N
Warnings : 1

New User


Joined: 05 Aug 2008
Posts: 16
Location: India

PostPosted: Thu Aug 14, 2008 3:10 pm
Reply with quote

could you please explain me with example?
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Aug 14, 2008 3:42 pm
Reply with quote

What happens when you type TSO ISRDDN on the command line ?

You get a list of DDnames and associated datasets.

Copy the ISPMLIB, ISPPLIB, ISPSLIB, ISPTLIB, ISPTABL, SYSEXEC & SYSPROC DDnames and datasets into your JCL.
Back to top
View user's profile Send private message
seshagiri.N
Warnings : 1

New User


Joined: 05 Aug 2008
Posts: 16
Location: India

PostPosted: Thu Aug 14, 2008 3:50 pm
Reply with quote

Code:
//STEPLIB DD DSN=SYS7A.ISPF.ISPMLIB,DISP=SHR
//        DD DSN=SYS7A.ISPF.ISPPLIB,DISP=SHR
//        DD DSN=SYS7A.ISPF.ISPSLIB,DISP=SHR
//        DD DSN=SYS7A.ISPF.ISPTLIB,DISP=SHR
//        DD DSN=SYS7.GLOBAL.ISPLLIB,DISP=SHR
//        DD DSN=SYS7A.ISPF.ISPTLIB,DISP=SHR
//        DD DSN=SYS7A.ISPF.CLIST,DISP=SHR   


i this how you are taking abt?
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Aug 14, 2008 4:05 pm
Reply with quote

So when you looked under ISRDDN were all of the datasets shown in your previous post all allocated to DDname STEPLIB ?
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Thu Aug 14, 2008 9:52 pm
Reply with quote

ISPF has several dd names that must be used. Your JCL needs to have those DD names added. And from your example, it looks like you incorrectly added them to your STEPLIB dd name.
Back to top
View user's profile Send private message
seshagiri.N
Warnings : 1

New User


Joined: 05 Aug 2008
Posts: 16
Location: India

PostPosted: Sat Aug 16, 2008 2:28 pm
Reply with quote

Can you provide me a sample JCL?
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Sun Aug 17, 2008 2:13 am
Reply with quote

When you are logged on and using ISPF, issue TSO ISRDDN and look at the dd names used and the datasets allocated to those DD names. Based on your earlier post, your JCL should include:

Code:
//STEPLIB DD DSN=SYS7.GLOBAL.ISPLLIB,DISP=SHR
//ISPMLIB DD DSN=SYS7A.ISPF.ISPMLIB,DISP=SHR
//ISPPLIB DD DSN=SYS7A.ISPF.ISPPLIB,DISP=SHR
//ISPSLIB DD DSN=SYS7A.ISPF.ISPSLIB,DISP=SHR
//ISPTLIB DD DSN=SYS7A.ISPF.ISPTLIB,DISP=SHR
//SYSPROC DD DSN=SYS7A.ISPF.CLIST,DISP=SHR
Back to top
View user's profile Send private message
seshagiri.N
Warnings : 1

New User


Joined: 05 Aug 2008
Posts: 16
Location: India

PostPosted: Mon Aug 18, 2008 8:47 pm
Reply with quote

I got the same result. icon_sad.gif icon_sad.gif icon_sad.gif

Please have a look at my JCL and REXX program:

JCL:

Code:
JOB CARD
//STEPLIB DD DSN=SYS7.GLOBAL.ISPLLIB,DISP=SHR
//ISPMLIB DD DSN=SYS7A.ISPF.ISPMLIB,DISP=SHR
//ISPPLIB DD DSN=SYS7A.ISPF.ISPPLIB,DISP=SHR
//ISPSLIB DD DSN=SYS7A.ISPF.ISPSLIB,DISP=SHR
//ISPTLIB DD DSN=SYS7A.ISPF.ISPTLIB,DISP=SHR
//SYSPROC DD DSN=SYS7A.ISPF.CLIST,DISP=SHR   
//TSOBATCH EXEC PGM=IKJEFT1A,DYNAMNBR=200   
//SYSEXEC DD DSN=NBDKYGS.REXX.EXEC,DISP=SHR 
//SYSPRINT DD SYSOUT=*                       
//SYSTSPRT DD SYSOUT=*                       
//SYSTSIN DD *
EXEC1         
/*           


REXX:

Code:
/*****REXX******/
ADDRESS TSO                                             
"ALLOC F(ISFIN) TRACKS SPACE(1) REU" /* USED BY SDSF */ 
"ALLOC F(ISFOUT) NEW DELETE REU " , /* USED BY SDSF */   
"TRACKS SPACE(100,100) LRECL(133) RECFM(F,B,A) DSORG(PS)"
"ALLOC F(TEMPPRT) DA('NBDKYGS.REXX.JOB2(OUT5)') SHR REUSE"       
JOBID = "JOB09601"                                               
QUEUE "PRE IQ1TSACE" /* SDSF COMMANDS IN BATCH*/                 
QUEUE "ST"                                                       
QUEUE "FILTER JOBNAME " JOBID                                   
QUEUE "++S"                                                     
QUEUE "PRINT FILE TEMPPRT" /* PRINT TO TEMP DATASET */           
QUEUE "PRINT 1 999999"                                           
QUEUE "PRINT CLOSE"                                             
QUEUE "END"                                                     
QUEUE "EXIT"                                                     
"EXECIO" QUEUED()" DISKW ISFIN (FINIS" /* INPUT TO SDSF BATCH */
ADDRESS ISPEXEC "SELECT PGM(ISFAFD) PARM('++25,80')"/* INVOKE SDSF */
EXIT                                                                 



please tell me where i did mistake.
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Mon Aug 18, 2008 10:04 pm
Reply with quote

The exec statement marks the beginning of the step.
Code:
//TSOBATCH EXEC PGM=IKJEFT1A,DYNAMNBR=200

The DD statements should be after it. And STEPLIB is first after EXEC.
Back to top
View user's profile Send private message
seshagiri.N
Warnings : 1

New User


Joined: 05 Aug 2008
Posts: 16
Location: India

PostPosted: Mon Aug 18, 2008 10:16 pm
Reply with quote

I tried this ... but the same result.

I am getting MAXCC=0, when job submitted.

and got

Code:

READY                                                                           
EXEC1                                                                           
    25 *-* ADDRESS ISPEXEC "SELECT PGM(ISFAFD) PARM('++25,80')"/* INVOKE SDSF */
       +++ RC(-3) +++                                                           
READY                                                                           
END                                                                             
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Mon Aug 18, 2008 10:34 pm
Reply with quote

Use of ISPEXEC requires an ISPF environment (which is why you need the DD statements). So, start ISPF first, passing it the parm to start your exec

Code:
//SYSTSIN DD *         
 ISPSTART CMD(%exec1) 
/*EOF                   
Back to top
View user's profile Send private message
seshagiri.N
Warnings : 1

New User


Joined: 05 Aug 2008
Posts: 16
Location: India

PostPosted: Tue Aug 19, 2008 4:12 pm
Reply with quote

Job ended with return code of 0998. I found this in the spool.

Code:
READY                                                                       
ISPSTART CMD(%EXEC1)                                                         
CMG999   Message ISPT036 - ISPT036  message not found in 'ISPMLIB' library. 
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Aug 19, 2008 4:23 pm
Reply with quote

My first guess would be that you have not concatenated all of the ISPMLIb libraries allocated to your ISPF online session into the batch version.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies. View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts run rexx code with jcl CLIST & REXX 15
No new posts Execute secondary panel of sdsf with ... CLIST & REXX 1
Search our Forums:

Back to Top