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
 

 

To Get the list of Empty Members from a PDS

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
pawan1986

New User


Joined: 27 Jun 2014
Posts: 2
Location: INDIA

PostPosted: Tue Nov 04, 2014 2:00 am    Post subject: To Get the list of Empty Members from a PDS
Reply with quote

I want to list all the empty members of a pds, I was trying the below steps.

Step-1: giving SAVE command in the command line and getting all the members details into a PS.

Step-2: Using the sort card getting only the list having the Size 0.

is there any other way to get in a single step
Back to top
View user's profile Send private message

Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1609
Location: NY,USA

PostPosted: Tue Nov 04, 2014 3:00 am    Post subject:
Reply with quote

IEHLIST using the LISTPDS control statement
Back to top
View user's profile Send private message
pawan1986

New User


Joined: 27 Jun 2014
Posts: 2
Location: INDIA

PostPosted: Tue Nov 04, 2014 3:02 am    Post subject: Reply to: To Get the list of Empty Members from a PDS
Reply with quote

Tried with IEHLIST, but not able to execute LISTPDS control statments
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1609
Location: NY,USA

PostPosted: Tue Nov 04, 2014 4:10 am    Post subject:
Reply with quote

http://ibmmainframes.com/about46087.html
http://ibmmainframes.com/about19315.html
http://pic.dhe.ibm.com/infocenter/zos/v1r11/topic/com.ibm.zos.r11.idau100/dgt2u15018.htm
Back to top
View user's profile Send private message
steve-myers

Active User


Joined: 30 Nov 2013
Posts: 461
Location: The Universe

PostPosted: Tue Nov 04, 2014 9:12 am    Post subject: Re: To Get the list of Empty Members from a PDS
Reply with quote

pawan1986 wrote:
I want to list all the empty members of a pds, I was trying the below steps.

Step-1: giving SAVE command in the command line and getting all the members details into a PS.

Step-2: Using the sort card getting only the list having the Size 0.

is there any other way to get in a single step
This procedure will show show empty members that have ISPF statistics. Determining if a member that does not have ISPF statistics is empty is more difficult.

IEHLIST LISTPDS will not directly show empty members. As the topic starter has already noted, getting IEHLIST LISTPDS to work for a cataloged data set is difficult.

Ultimately, the only way to detect an empty member is to read it. If it immediately goes to EOF, it's empty. The following little program will serve -
Code:
EMEMB    CSECT
         USING *,12
         SAVE  (14,12),,*
         LR    12,15
         LA    15,SAVEAREA
         ST    13,4(,15)
         ST    15,8(,13)
         LR    13,15
         OPEN  MF=(E,OPARM1)
         LTR   15,15
         BZ    CHKUT1
         WTO   MF=(E,MSG01)
         B     EXIT
CHKUT1   RDJFCB MF=(E,OPARM2)
         LTR   15,15
         BZ    CHKPDS
         MVC   MSG02DD,(DCBDDNAM-IHADCB)+DIRDCB
         PUT   PRINT,MSG02
         B     EXIT
CHKPDS   SR    0,0
         OBTAIN CAMLST
         LTR   15,15
         BZ    TESTDSCB
         MVC   MSG03DSN,JFCBDSNM
         MVC   MSG03VOL,JFCBVOLS
         PUT   PRINT,MSG03
         B     EXIT
TESTDSCB ICM   0,B'0011',(DS1DSORG-DS1FMTID)+F1DSCB
         N     0,=AL1(0,0,255-DCBDSGU,255)
         CLM   0,B'0011',=AL1(DCBDSGPO,0)
         BE    OPENPDS
         MVC   MSG04DSN,JFCBDSNM
         MVC   MSG04VOL,JFCBVOLS
         PUT   PRINT,MSG04
         B     EXIT
OPENPDS  OPEN  MF=(E,OPARM3)
         LTR   15,15
         BZ    GETBUF
         DC    H'0'
GETBUF   GETBUF PDSDCB,(2)
         ST    2,(DECAREA-DECB)+PDSDECB
SCANDIR  GET   DIRDCB
         LH    5,0(,1)
         LA    3,2(,1)
         AR    5,1
         BCTR  5,0
GETMEMB  CLC   =FL8'-1',0(3)
         BE    DIREOF
         SR    2,2
         MVC   MSG06MBR,0(3)
         MVC   TTR,8(3)
         FIND  PDSDCB,TTRN,C
         LA    0,1
         A     0,MCOUNT
         ST    0,MCOUNT
         READ  PDSDECB,SF,MF=E
         CHECK PDSDECB
         LA    2,1(,2)
PDSEOF   LTR   2,2
         BNZ   NEXTMEMB
         TM    MSG05DSN,255-C' '
         BNZ   SKIPHDR
         MVC   MSG05DSN,JFCBDSNM
         MVC   MSG05VOL,JFCBVOLS
         PUT   PRINT,MSG05
SKIPHDR  PUT   PRINT,MSG06
NEXTMEMB IC    4,11(,3)
         N     4,=A(X'1F')
         LA    4,12(4,4)
         BXLE  3,4,GETMEMB
         B     SCANDIR
DIREOF   TM    MSG05DSN,255-C' '
         BNZ   LISTCNT
         MVC   MSG07DSN,JFCBDSNM
         MVC   MSG07VOL,JFCBVOLS
         PUT   PRINT,MSG07
LISTCNT  MVC   MSG08CNT,=X'402020202120'
         L     0,MCOUNT
         CVD   0,16(,13)
         ED    MSG08CNT,16+5(13)
         PUT   PRINT,MSG08
EXIT     LA    1,CPARM3
         BAS   14,CLOSELST
         LA    1,CPARM1
         BAS   14,CLOSELST
         L     13,4(,13)
         RETURN (14,12),T,RC=0
         EJECT
         CNOP  0,8
CLOSELST BASR  15,0
         SAVE  (14,2),,CLOSELST
         LR    2,1
         CLOSE MF=(E,(2))
CL0100   L     1,0(,2)
         N     1,=A(X'FFFFFF')
         TM    DCBOFLGS-IHADCB(1),DCBOFOPN
         BO    CL0200
         TM    (DCBBUFCB-IHADCB)+3(1),1
         BO    CL0200
         FREEPOOL (1)
CL0200   TM    0(2),X'80'
         LA    2,4(,2)
         BZ    CL0100
         RETURN (14,2),T
         EJECT
SAVEAREA DC    9D'0'
         PUSH  PRINT
         PRINT NOGEN
OPARM1   OPEN  (PRINT,OUTPUT),MF=L
OPARM2   OPEN  (DIRDCB,INPUT),MF=L
OPARM3   OPEN  (DIRDCB,INPUT,PDSDCB,INPUT),MF=L
CPARM3   CLOSE (DIRDCB,,PDSDCB),MF=L
CPARM1   CLOSE (PRINT),MF=L
CAMLST   CAMLST SEARCH,JFCBDSNM,JFCBVOLS,F1DSCB
         READ  PDSDECB,SF,PDSDCB,*-*,'S',MF=L
PRINT    DCB   DSORG=PS,MACRF=PM,DDNAME=SYSPRINT,RECFM=VBA,LRECL=125
DIRDCB   DCB   DSORG=PS,MACRF=GL,DDNAME=SYSUT1,EODAD=DIREOF,          ->
               RECFM=F,LRECL=256,BLKSIZE=256,EXLST=XLIST
PDSDCB   DCB   DSORG=PO,MACRF=R,DDNAME=SYSUT1,EODAD=PDSEOF,BUFNO=1
XLIST    DC    0A(0),AL1(X'80'+7),AL3(JFCB)
JFCB     DC    0XL176'0'
         IEFJFCBN ,
         POP   PRINT
F1DSCB   DC    XL140'0'
         SPACE 1
MSG01    WTO   'EMEMB - UNABLE TO OPEN SYSPRINT',MF=L,ROUTCDE=11,DESC=7
         SPACE 1
MSG02    DC    AL2(MSG02L,0),C' NO DD STATEMENT FOR '
MSG02DD  DC    CL8' '
MSG02L   EQU   *-MSG02
         SPACE 1
MSG03    DC    AL2(MSG03L,0),C' '
MSG03DSN DC    CL44' ',C' IS NOT ON VOLUME '
MSG03VOL DC    CL6' '
MSG03L   EQU   *-MSG03
         SPACE 1
MSG04    DC    AL2(MSG04L,0),C' '
MSG04DSN DC    CL44' ',C' ON VOLUME '
MSG04VOL DC    CL6' ',C' IS NOT A PDS'
MSG04L   EQU   *-MSG04
         SPACE 1
MSG05    DC    AL2(MSG05L,0),C' THE FOLLOWING MEMBERS IN '
MSG05DSN DC    CL44' ',C' ON VOLUME '
MSG05VOL DC    CL6' ',C' ARE EMPTY -'
MSG05L   EQU   *-MSG05
         SPACE 1
MSG06    DC    AL2(MSG06L,0),C' '
MSG06MBR DC    CL8' '
MSG06L   EQU   *-MSG06
         SPACE 1
MSG07    DC    AL2(MSG07L,0),C' NO MEMBERS IN '
MSG07DSN DC    CL44' ',C' ON VOLUME '
MSG07VOL DC    CL6' ',C' ARE EMPTY'
MSG07L   EQU   *-MSG07
         SPACE 1
MSG08    DC    AL2(MSG08L,0)
MSG08CNT DC    C' NNNNN',C' MEMBERS CHECKED'
MSG08L   EQU   *-MSG08
         DC    0D'0'
         LTORG ,
TTRN     DC    0F'0'
TTR      DC    XL3'0',X'00'
MCOUNT   DC    F'0'
         DC    0D'0'
         PUSH  PRINT
         PRINT NOGEN
         DCBD  DSORG=QS,DEVD=DA
         IHADECB DSECT=YES
DSCB     DSECT
         IECSDSL1 1
         POP   PRINT
         END   EMEMB
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Cobol list of programs being called biswajit.dattagupta COBOL Programming 5 Tue Nov 01, 2016 2:10 am
No new posts reorder screeNS using SWAP LIST? mrsidhu12 TSO/ISPF 5 Thu Sep 01, 2016 2:19 pm
No new posts Getting list of tables defined under ... kishpra DB2 2 Wed Aug 24, 2016 10:36 am
No new posts Unstring list of values into an array. Roshnii COBOL Programming 8 Mon Jun 27, 2016 6:25 pm
This topic is locked: you cannot edit posts or make replies. how to find if file is empty or not. abdulrafi DFSORT/ICETOOL 5 Tue May 17, 2016 4:39 pm


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