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
 

 

List and write all the PDS name to the file in Batch

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
Santty

New User


Joined: 20 Nov 2007
Posts: 37
Location: USA

PostPosted: Wed Jul 10, 2013 8:36 pm    Post subject: List and write all the PDS name to the file in Batch
Reply with quote

Hi I am able to list the PDS and write it to a file when executing a REXX through TSO command. It worked fine.
But when i tried to write a batch job i am receving RC = 20 in the below line
Code:
"ISPEXEC LMDINIT LISTID("IDV") LEVEL("DS")"



This is my REXX program
Code:

/*REXX*/                                                           
/************ GET THE LIST OF CMN PDS   ********/                 
ARG DATASET                                                       
DS     = DATASET                                                   
SAY 'DATASET:' DS                                                 
                 
ADDRESS TSO                                                       
"ISPEXEC LMDINIT LISTID("IDV") LEVEL("DS")"                       
SAY RC                                                             
IX = 0                                                             
DO FOREVER                                                         
  "ISPEXEC LMDLIST LISTID("IDV") OPTION(LIST) DATASET(DSVAR)"     
  IF RC <> 0 THEN DO                                               
     "ISPEXEC LMDLIST LISTID("IDV") OPTION(FREE)"                 
     LEAVE                                                         
  END
.....                                                             


My JCL
Code:

//STEP10   EXEC PGM=IKJEFT01,REGION=0M,                           
//             PARM='GETALPDS HLQ.**'                         
//SYSPROC  DD  DISP=SHR,DSN=REXXPDS.REXX                   
//SYSTSPRT DD SYSOUT=*                                           
//SYSPRINT DD SYSOUT=*                                           
//ISPMLIB  DD DSN=HLQ.ISPMLIB,DISP=SHR             
//ISPPLIB  DD DSN=HLQ.ISPPLIB,DISP=SHR             
//ISPSLIB  DD DSN=HLQ.ISPSLIB,DISP=SHR             
//ISPLLIB  DD DSN=HLQ.LOAD,DISP=SHR                     
//SYSTSIN DD DUMMY                                               
//FILEOUT  DD  DSN=HLQ.LIST,    * OUTPUT FILE
//             DISP=(NEW,CATLG,DELETE),SPACE=(CYL,(15,5),RLSE),   
//             UNIT=SYSDA,DCB=(RECFM=FB,LRECL=080,BLKSIZE=0)     
//ISPPROF   DD DSN=&&PROFILE,                                     
//             DISP=(,DELETE,DELETE),                             
//             UNIT=SYSDA,                                       
//             SPACE=(TRK,(1,1,1),RLSE),                         
//             DCB=(RECFM=FB,LRECL=80,BLKSIZE=0)                 


PLease let me know if i am missing anything ...
Back to top
View user's profile Send private message

Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1713
Location: UK

PostPosted: Wed Jul 10, 2013 8:45 pm    Post subject:
Reply with quote

Yes - you missed a [/code] and obviously the Preview button is missing from your editor.
Also, when invoking IKJEFT01 it is normal to provide SYSTSIN to let it know what it should be doing.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


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

PostPosted: Wed Jul 10, 2013 8:51 pm    Post subject:
Reply with quote

You appear to be passing the namme of the Rexx script to background TSO via the PARM parameter. This is entirely acceptable when using TSO only; when using ISPF, however, you should use a SYSTSIN DD, as Mr. Clouston has said, and invoke ISPF via ISPSTART CMD(scriptname).
Back to top
View user's profile Send private message
Santty

New User


Joined: 20 Nov 2007
Posts: 37
Location: USA

PostPosted: Wed Jul 10, 2013 10:46 pm    Post subject: Reply to: List and write all the PDS name to the file in Bat
Reply with quote

But still i am receving ISPV010 message not found in 'ISPMLIB' library.
Code:

CMG999   Message ISPV010 - ISPV010  message not found in 'ISPMLIB' library. 


My JCL
Code:

//STEP10   EXEC PGM=IKJEFT01,REGION=0M                           
//SYSPROC  DD  DISP=SHR,DSN=HLQ.REXX                     
//SYSTSPRT DD SYSOUT=*                                             
//SYSPRINT DD SYSOUT=*                                             
//ISPMLIB  DD DSN=HLQ.ISPMLIB,DISP=SHR               
//ISPPLIB  DD DSN=HLQ.ISPPLIB,DISP=SHR               
//ISPSLIB  DD DSN=HLQ.ISPSLIB,DISP=SHR               
//ISPTLIB  DD DDNAME=ISPTABL                                       
//         DD DSN=HLQ.ISPTLIB,DISP=SHR               
//ISPTABL  DD DSN=HLQ.ISPTLIB,DISP=SHR                     
//ISPLLIB  DD DSN=HLQ.LOAD,DISP=SHR                     
//SYSTSIN DD *                                                     
ISPSTART CMD('MYPDS(MEMBER)' HLQ.**)             
//*                                                               
//FILEOUT  DD  DSN=HLQ.LIST,        * OUTPUT FILE
//             DISP=(NEW,CATLG,DELETE),SPACE=(CYL,(15,5),RLSE),   
//             UNIT=SYSDA,DCB=(RECFM=FB,LRECL=080,BLKSIZE=0)   
//ISPPROF   DD DSN=&&PROFILE,                                 
//             DISP=(,DELETE,DELETE),                         
//             UNIT=SYSDA,                                     
//             SPACE=(TRK,(1,1,1),RLSE),                       
//             DCB=(RECFM=FB,LRECL=80,BLKSIZE=0)               
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


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

PostPosted: Wed Jul 10, 2013 11:04 pm    Post subject:
Reply with quote

Why do you not concatenate mypds to SYSPROC instead of trying to put it in the CMD parameter?
Back to top
View user's profile Send private message
Santty

New User


Joined: 20 Nov 2007
Posts: 37
Location: USA

PostPosted: Wed Jul 10, 2013 11:10 pm    Post subject: Reply to: List and write all the PDS name to the file in Bat
Reply with quote

Yes... I tried that too but no luck ...

I am getting the same error message
CMG999 Message ISPV010 - ISPV010 message not found in 'ISPMLIB' library.

I am not sure what is missing here....
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7905
Location: Bellevue, IA

PostPosted: Wed Jul 10, 2013 11:16 pm    Post subject:
Reply with quote

You don't have your site's system ISPF messages library concatenated to ISPMLIB. ISPV010 is a standard system message usually stored in the site ISPF message library.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


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

PostPosted: Wed Jul 10, 2013 11:23 pm    Post subject:
Reply with quote

I see that you have posted only a part of your script. It is short enough that you can post the whole thing?
Back to top
View user's profile Send private message
Pedro

Senior Member


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

PostPosted: Thu Jul 11, 2013 12:11 am    Post subject: Reply to: List and write all the PDS name to the file in Bat
Reply with quote

Quote:
I am not sure what is missing here....

Besides the messages library, you also should provide the other ISPF data sets.

For example, message ISPV010 is:
Code:
ISPV010 Profile not loaded -  Profile table 'aaaaaaaa' not read.
       Table service RC=bbbbbbbb.                               

and shows that you are missing the ISPTLIB concatenation.
Back to top
View user's profile Send private message
Santty

New User


Joined: 20 Nov 2007
Posts: 37
Location: USA

PostPosted: Thu Jul 11, 2013 12:41 am    Post subject: Reply to: List and write all the PDS name to the file in Bat
Reply with quote

Please find the full script

JCL
Code:

//Jobname  JOB (1234567),' ',         
//         CLASS=?,MSGCLASS=?,NOTIFY=&SYSUID           
//*                                                     
//******************************************************
//*   GET ALL THE PDS NAMES                             
//******************************************************
//*                                                     
//STEP10   EXEC PGM=IKJEFT01,REGION=0M                 
//*            PARM='ISPSTART CMD(MEMBER) HLQ.**' 
//SYSPROC  DD  DISP=SHR,DSN=HLQ.REXX         
//SYSTSPRT DD SYSOUT=*                                 
//SYSPRINT DD SYSOUT=*                                 
//ISPMLIB  DD DSN=HLQ.ISPMLIB,DISP=SHR             
//ISPPLIB  DD DSN=HLQ.ISPPLIB,DISP=SHR             
//ISPSLIB  DD DSN=HLQ.ISPSLIB,DISP=SHR             
//ISPTLIB  DD DDNAME=ISPTABL                                     
//         DD DSN=HLQ.ISPTLIB,DISP=SHR             
//ISPTABL  DD DSN=HLQ.ISPTLIB,DISP=SHR                   
//ISPLLIB  DD DSN=HLQ.LOAD,DISP=SHR                     
//SYSTSIN DD *                                                   
ISPSTART CMD(MEMBER HLQ.**)                                 
//*                                                               
//FILEOUT  DD  DSN=HLQ.LIST,    * OUTPUT FILE
//             DISP=(NEW,CATLG,DELETE),SPACE=(CYL,(15,5),RLSE),   
//             UNIT=SYSDA,DCB=(RECFM=FB,LRECL=080,BLKSIZE=0)     
//ISPPROF   DD DSN=&&PROFILE,                                   
//             DISP=(,DELETE,DELETE),                           
//             UNIT=SYSDA,                           
//             SPACE=(TRK,(1,1,1),RLSE),             
//             DCB=(RECFM=FB,LRECL=80,BLKSIZE=0)     
//                                                   



MEMBER is the REXX program

REXX program

Code:

/*REXX*/                                                       
/************ GET THE LIST OF CMN PDS   ********/             
ARG DATASET                                                   
DS     = DATASET                                               
SAY 'DATASET:' DS                                             
ADDRESS TSO                                                   
"ISPEXEC LMDINIT LISTID("IDV") LEVEL("DS")"                   
SAY RC                                                         
IX = 0                                                         
DO FOREVER                                                     
  "ISPEXEC LMDLIST LISTID("IDV") OPTION(LIST) DATASET(DSVAR)" 
  IF RC <> 0 THEN DO                                           
     "ISPEXEC LMDLIST LISTID("IDV") OPTION(FREE)"             
     LEAVE                                                     
  END                                                       
  IX = IX + 1                                               
  WORK.IX  = DSVAR                                         
  SAY "DSVAR:" DSVAR                                       
  IF (SUBSTR(WORK.IX,23,1) =  ' ') & ,                     
     (SUBSTR(WORK.IX,19,1) <> ' ') THEN                     
     QUEUE SUBSTR(DSVAR,10,4) SUBSTR(DSVAR,15,3) WORK.IX   
     SAY WORK.IX                                           
END                                                         
  ADDRESS TSO                                               
  "EXECIO" QUEUED() "DISKW FILEOUT ( FINIS"                 
  "FREE F(FILEOUT)"                                         
  SAY 'RC:'RC                                               
  ADDRESS TSO "DELSTACK"                                   
EXIT                                                       
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


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

PostPosted: Thu Jul 11, 2013 1:11 am    Post subject:
Reply with quote

If your shop has a standard ISPF proc, I suggest that you use it, so as to avoid the problems noted by Mr. Sample and Sr. Vera. If you do so, I think that you will find no further problems with your script.
Back to top
View user's profile Send private message
Pedro

Senior Member


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

PostPosted: Thu Jul 11, 2013 3:45 am    Post subject: Reply to: List and write all the PDS name to the file in Bat
Reply with quote

I noticed you use a stem variable, as if you are going to use the STEM form of the EXECIO command. But instead, you use the form that gets its data from the stack.

I do not think you need to use a stem variable:
Code:
  IX = IX + 1                                               
  WORK.IX  = DSVAR                 

And other places. Instead, use DSVAR where you use WORK.IX

Your code will work regardless, except if you have an extremely large number of members. In that case, you will have a copy of the data in the stem, as well as a copy QUEUE'd up, plus a copy that ISPF maintains via LMDLIST. You may encounter storage exhausted problems.
Back to top
View user's profile Send private message
Santty

New User


Joined: 20 Nov 2007
Posts: 37
Location: USA

PostPosted: Fri Jul 12, 2013 12:50 am    Post subject: Reply to: List and write all the PDS name to the file in Bat
Reply with quote

Thank you Akatsukami, Sample , Vera and Clouston .. icon_smile.gif

I added ISPLOG and made some changes to the ISPTLIB.

The program is working fine now.

But is can see a message at the end of SYSTSPRT as below

Code:
MYRACFID.MYRACFID.JOBID.D0000103.? was preallocated (no free was done).


Can you please help me in this ??
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


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

PostPosted: Fri Jul 12, 2013 1:14 am    Post subject:
Reply with quote

IIRC, this is because you did add the ISPLOG DD to the JCL; ISPF warns you that it wished to allocate the data set dynamically. Remove the DD, and the message should go away.
Back to top
View user's profile Send private message
Santty

New User


Joined: 20 Nov 2007
Posts: 37
Location: USA

PostPosted: Fri Jul 12, 2013 1:19 am    Post subject: Reply to: List and write all the PDS name to the file in Bat
Reply with quote

Yes .. You are right.

But if i remove ISPLOG i am receving the below message

Code:

ISPF system data set allocation error - press Enter to continue.         
Log file allocation error - ISPF will operate without a log data set.   
Data set 'MYRACFID.SPFLOG1.LIST' in use by another user, try later.       
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1713
Location: UK

PostPosted: Fri Jul 12, 2013 2:39 am    Post subject:
Reply with quote

That other user is you - most likely. you probably do not need the log so you could dummy it.
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 Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
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 File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm


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