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
 

 

Equivelent of 3.4 dataset list run in batch.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
View previous topic :: :: View next topic  
Author Message
dick scherrer

Site Director


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

PostPosted: Thu Sep 26, 2013 7:05 pm    Post subject: Equivelent of 3.4 dataset list run in batch.
Reply with quote

'Morning,

Looked at several previous topics and have not yet found one like i'm looking for.

What i want to do is run "3.4" in batch and write the selected file list/volsers to dasd.

I know i've done this in a prior life, but cannot remember the specifics.

When i submit:
Code:
//STEP01   EXEC PGM=IKJEFT01,DYNAMNBR=200                         
//SYSPRINT DD SYSOUT=*                                             
//SYSTSPRT DD SYSOUT=*                                             
//OUTDD    DD DSN=MY.TEST.DSNS,DISP=(,CATLG,DELETE), 
//            DATACLAS=DCDFAULT,SPACE=(CYL,(5,5),RLSE),           
//            DCB=(RECFM=FB)                                       
//SYSTSIN  DD *                                                   
LISTC LV('MY.*') OUTFILE(OUTDD)                                   
/*

i get:
Code:
IEC141I 013-34
on the OUTDD and:
Code:
READY                                       
LISTC LV('MS.*') OUTFILE(OUTDD)             
 ERROR OPENING MY.TEST.DSNS     
** OPEN/CLOSE/EOV ABEND EXIT TAKEN           
LASTCC=12                                   
READY                                       
END     

in the sysout. . .

Tried several variations of the DCB info as well as left it off.

Where have i stepped on my foot icon_rolleyes.gif

Thanks,

d
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Thu Sep 26, 2013 7:42 pm    Post subject:
Reply with quote

Dick, try this - it uses exactly the same masking as 3.4 does too
It's basically IGGCSIRX from SYS1.SAMPLIB.

JCL
Code:

//STEP0020 EXEC PGM=IKJEFT01,PARM='CSI00'     
//SYSEXEC  DD DSN=Your REXX library,DISP=SHR           
//SYSOUT   DD SYSOUT=*                       
//SYSTSPRT DD SYSOUT=*                       
//SYSTSIN  DD DUMMY                           
//CATIN    DD *                               
XX.YY.CAPTURE.G%%%%V00
ABC.DE%.**       


REXX - Member CSI00 in Your REXX library
Code:

/* REXX ** INVOKE CSI VIA BATCH REXX PROCESS                         */

 /********************************************************************/
 /*       NAME: IGGCSIRX                                             */
 /********************************************************************/
 "EXECIO * DISKR CATIN ( STEM CAT. FINIS"  /* READ KEY SELECTIONS    */
 DO KCNT = 1 TO CAT.0                      /* PROCESS SELECTIONS     */
 KEY = SUBSTR(CAT.KCNT,1,44)               /* GET KEY                */
 /********************************************************************/
 /*  INITIALIZE THE PARM LIST                                        */
 /********************************************************************/
MODRSNRC = SUBSTR(' ',1,4)          /*   CLEAR MODULE/RETURN/REASON  */
CSIFILTK = SUBSTR(KEY,1,44)         /*   MOVE FILTER KEY INTO LIST   */
CSICATNM = SUBSTR(' ',1,44)         /*   CLEAR CATALOG NAME          */
CSIRESNM = SUBSTR(' ',1,44)         /*   CLEAR RESUME NAME           */
CSIDTYPS = SUBSTR(' ',1,16)         /*   CLEAR ENTRY TYPES           */
CSICLDI  = SUBSTR('Y',1,1)          /*   INDICATE DATA AND INDEX     */
CSIRESUM = SUBSTR(' ',1,1)          /*   CLEAR RESUME FLAG           */
CSIS1CAT = SUBSTR(' ',1,1)          /*   INDICATE SEARCH > 1 CATALOGS*/
CSIRESRV = SUBSTR(' ',1,1)          /*   CLEAR RESERVE CHARACTER     */
CSINUMEN = '0001'X                  /*   INIT NUMBER OF FIELDS       */
CSIFLD1  = 'VOLSER  '               /*   INIT FIELD 1 FOR VOLSERS    */
 /********************************************************************/
 /*  BUILD THE SELECTION CRITERIA FIELDS PART OF PARAMETER LIST      */
 /********************************************************************/
CSIOPTS  = CSICLDI || CSIRESUM || CSIS1CAT || CSIRESRV
CSIFIELD = CSIFILTK || CSICATNM || CSIRESNM || CSIDTYPS || CSIOPTS
CSIFIELD = CSIFIELD || CSINUMEN || CSIFLD1
 /********************************************************************/
 /*  INITIALIZE AND BUILD WORK ARE OUTPUT PART OF PARAMETER LIST     */
 /********************************************************************/
WORKLEN = 65536                    /* 64K WORK AREA                  */
DWORK = '00010000'X || COPIES('00'X,WORKLEN-4)
 /********************************************************************/
 /*  INITIALIZE WORK VARIABLES                                       */
 /********************************************************************/
RESUME = 'Y'
CATNAMET = SUBSTR(' ',1,44)
DNAMET = SUBSTR(' ',1,44)
 /********************************************************************/
 /*  SET UP LOOP FOR RESUME (IF A RESUME IS NCESSARY)                */
 /********************************************************************/
DO WHILE RESUME = 'Y'
 /********************************************************************/
 /*  ISSUE LINK TO CATALOG GENERIC FILTER INTERFACE                  */
 /********************************************************************/
 ADDRESS LINKPGM 'IGGCSI00  MODRSNRC  CSIFIELD  DWORK'

 RESUME = SUBSTR(CSIFIELD,150,1)    /* GET RESUME FLAG FOR NEXT LOOP */
 USEDLEN = C2D(SUBSTR(DWORK,9,4))   /* GET AMOUNT OF WORK AREA USED  */
 POS1=15                            /* STARTING POSITION             */

 /********************************************************************/
 /*  PROCESS DATA RETURNED IN WORK AREA                              */
 /********************************************************************/
 DO WHILE POS1 < USEDLEN            /* DO UNTIL ALL DATA IS PROCESSED*/
   IF SUBSTR(DWORK,POS1+1,1) = '0'  /* IF CATALOG, PRINT CATALOG HEAD*/
    THEN DO
         CATNAME=SUBSTR(DWORK,POS1+2,44)
         IF CATNAME ^= CATNAMET THEN /* IF RESUME NAME MAY ALREADY BE*/
          DO                         /*    PRINTED                   */
/*         SAY 'CATALOG ' CATNAME       IF NOT, PRINT IT             */
/*         SAY ' '                                                   */
           CATNAMET = CATNAME
          END
         POS1 = POS1 + 50
         END

   DNAME = SUBSTR(DWORK,POS1+2,44)  /* GET ENTRY NAME                */
 /********************************************************************/
 /*  ASSIGN ENTRY TYPE NAME                                          */
 /********************************************************************/
   IF SUBSTR(DWORK,POS1+1,1) = 'C' THEN DTYPE = 'CLUSTER '
    ELSE
      IF SUBSTR(DWORK,POS1+1,1) = 'D' THEN DTYPE = 'DATA    '
     ELSE
      IF SUBSTR(DWORK,POS1+1,1) = 'I' THEN DTYPE = 'INDEX   '
     ELSE
      IF SUBSTR(DWORK,POS1+1,1) = 'A' THEN DTYPE = 'NONVSAM '
     ELSE
      IF SUBSTR(DWORK,POS1+1,1) = 'H' THEN DTYPE = 'GDS     '
     ELSE
      IF SUBSTR(DWORK,POS1+1,1) = 'B' THEN DTYPE = 'GDG     '
     ELSE
      IF SUBSTR(DWORK,POS1+1,1) = 'R' THEN DTYPE = 'PATH    '
     ELSE
      IF SUBSTR(DWORK,POS1+1,1) = 'G' THEN DTYPE = 'AIX     '
     ELSE
      IF SUBSTR(DWORK,POS1+1,1) = 'X' THEN DTYPE = 'ALIAS   '
     ELSE
      IF SUBSTR(DWORK,POS1+1,1) = 'U' THEN DTYPE = 'UCAT    '
     ELSE
      DTYPE = '        '
 /********************************************************************/
 /*  HAVE NAME AND TYPE, GET VOLSER INFO                             */
 /********************************************************************/
    POS1 = POS1 + 46
    NUMVOL = C2D(SUBSTR(DWORK,POS1+4,2))/6 /* HOW MANY VOLSERS ?     */
                                    /*                               */
    POS2 = POS1+6                   /* POSITION ON DATA              */
    VOLSER. = ""
    DO I = 1 TO NUMVOL              /* MOVE VOLSERS TO OUTPUT FIELDS */
      VOLSER.I = SUBSTR(DWORK,POS2,6)
      POS2 = POS2 + 6
    END
    IF DNAMET ^= DNAME THEN         /* IF RESUME, NAME MAY ALREADY   */
                                    /*    PRINTED                    */
    DO                              /* IF NOT, PRINT IT              */
     LISTVOL1 = VOLSER.1 ||" "|| VOLSER.2 ||" "|| VOLSER.3
     LISTVOL2 = VOLSER.4 ||" "|| VOLSER.5 ||" "|| VOLSER.6
     LISTVOL3 = VOLSER.7 ||" "|| VOLSER.8 ||" "|| VOLSER.9
     SAY  COPIES(' ',8) DTYPE DNAME LISTVOL1 LISTVOL2 LISTVOL3
     DNAMET=DNAME
    END
 /********************************************************************/
 /*   GET POSITION OF NEXT ENTRY                                     */
 /********************************************************************/
    POS1 = POS1 + C2D(SUBSTR(DWORK,POS1,2))
  END
END
END
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 Sep 26, 2013 8:16 pm    Post subject:
Reply with quote

Thank you kind sir!

Works like a champ! When i break it, i'll be back.

Surely this calls for repayment of multiple adult beverages . . . icon_cool.gif

Later,

d
Back to top
View user's profile Send private message
don.leahy

Active Member


Joined: 06 Jul 2010
Posts: 641
Location: Whitby, ON, Canada

PostPosted: Thu Sep 26, 2013 9:53 pm    Post subject:
Reply with quote

I know you already have your solution, but I wanted to remind everyone that the LMDLIST ISPF service is another possible way to skin this cat.
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 Sep 26, 2013 10:18 pm    Post subject:
Reply with quote

Hi Don,

If you have a working sample, i suspect it would be appreciated . . .

d
Back to top
View user's profile Send private message
Pedro

Senior Member


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

PostPosted: Thu Sep 26, 2013 11:42 pm    Post subject: Reply to: Equivelent of 3.4 dataset list run in batch.
Reply with quote

Here is a TSO example (the original post was about batch job):
Code:
/* REXX */                                                           
/*-----------------------------------------------------------------*/
/* GET ALL DATASETS WITH THE HIGH LEVEL QUALIFIER                  */
/* HLQ is the only parm.                                           */
/*                                                                 */
/* IF NO LEVEL IS PROVIDED, THE USERID IS USED AS A LEVEL.         */
/*                                                                 */
/*-----------------------------------------------------------------*/
parse arg lvl                                                         
if lvl = '' then lvl = sysvar('sysuid')                               
Address ISPEXEC                                                       
"LMDINIT LISTID(LISTID) LEVEL("lvl")"                                 
"LMDLIST LISTID("listid") OPTION(SAVE)  STATS(YES) GROUP(MYlist)"     
"LMDLIST LISTID("listid") OPTION(FREE)"                               
"LMDFREE LISTID("listid")"                                           
"EDIT DATASET(MYLIST.DATASETS)"                                       


Examples:
Code:
TSO %lmdlist1 PEDRO.JCL
TSO %lmdlist1 PEDRO.JC*


For batch, perhaps just remove the EDIT statement.
Back to top
View user's profile Send private message
don.leahy

Active Member


Joined: 06 Jul 2010
Posts: 641
Location: Whitby, ON, Canada

PostPosted: Fri Sep 27, 2013 6:04 pm    Post subject:
Reply with quote

I was about to post a sample when I saw that Pedro beat me to it. My sample is quite similar and was taken from a batch function that does a mass rename of data sets according our shop's local naming conventions.
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 -> TSO/ISPF 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 FTP - JCL failed while passing FTP co... Suneetha1612 JCL & VSAM 12 Wed Nov 16, 2016 7:33 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 Cobol list of programs being called biswajit.dattagupta COBOL Programming 5 Tue Nov 01, 2016 2:10 am
No new posts To trim spaces in a pipe delimited da... Nish84 COBOL Programming 16 Mon Oct 10, 2016 1:54 pm


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