Just realized that Billy Ashton has sent the email to my id with CC to IBM-MAIN and I just hit "Reply" instead of "Reply All".
Here is the response for the question Billy, SORT products do not have the ability to read all the members of a PDS, but there are other ways to get desired results. Here is the outline of the process. 1. Flatten the PDS using IEBPTPCH with SYSIN as PUNCH TYPORG=PO,STOPAFT=5 . (prints the first 5 lines of every member in the PDS) This will create a SEQuential File of RECFM=FBA pds of 81 bytes. The actual data starts from position 2 as the first byte has ANSI control character. Each member data will have a header named "MEMBER NAME" and the member name is at position 15. 2. Run DFSORT using this sequential file as Input. You can use INCLUDE COND TO filter the records you want. Make sure that SORTOUT has RECFM=FB coded in the JCL to make sure that the Final dataset is not an FBA dataset. //SORTOUT DD SYSOUT=*,RECFM=FB //SYSIN DD * OPTION COPY INCLUDE COND=(02,80,SS,EQ,C'KEYWORD1',OR, 02,80,SS,EQ,C'LONGKEYWORD2') INREC IFTHEN=(WHEN=(02,80,SS,EQ,C'KEYWORD1'), PARSE=(%01=(STARTAFT=C'KEYWORD1(', ENDBEFR=C')', FIXLEN=8)), BUILD=(%01,JFY=(SHIFT=LEFT), C'.', C'KEYWORD1', C'.', DATE1)), IFTHEN=(WHEN=(02,80,SS,EQ,C'LONGKEYWORD2'), PARSE=(%02=(STARTAFT=C'LONGKEYWORD2(', ENDBEFR=C')', FIXLEN=16)), BUILD=(%02,JFY=(SHIFT=LEFT), C'.', C'LONGKEYWORD2', C'.', DATE1)) OUTFIL BUILD=(1,80,SQZ=(SHIFT=LEFT)) /* Further if you have any questions please let me know Thanks, Kolusu DFSORT Development IBM Corporation IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU> wrote on 05/27/2020 01:41:10 PM: > From: Billy Ashton <bill00ash...@gmail.com> > To: IBM-MAIN@LISTSERV.UA.EDU > Date: 05/27/2020 01:42 PM > Subject: [EXTERNAL] Sort extracting values in PDS members > Sent by: IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU> > > Hi again! This group has been so helpful - especially Kolusu - and I > have one more question as I learn how to use SORT more creatively. > > I have a bunch of PDS files where I have to read through each member and > create some control cards based on the content in the member (due to the > nature of these files, the request needs to be vague). So here are the > questions: > 1. Is there a way to automatically read all members of a PDS? If not, I > can generate the individual file names with member in a separate > process. > 2. When I read each member, I will be looking for KEYWORD(value) - the > keyword will be either "KEYWORD1" or "LONGKEYWORD2" and will be within > the first 5 lines of the member, at which point I stop reading (some of > the members have 25000 lines!), and the Keyword could be anywhere on the > line, in column 1 or with a space delimiter. Keyword can be 8 or 12 > characters long, and Value can be 2 to 8 characters. > 3. I then need to create a string of -ADD- Value.Keyword.Dyyyymmdd > (Today's date) that I will use in my further processing. > > Note that I could write a program to manage this, but am trying to keep > the processing in a control member rather than a program, as utility > programs seem to get lost around here. > > Since I can't show you the real input, here is some contrived data: > > Member1: > KEYWORD1(val) Otherkw(val) Otherkey2(anothervalue) > Line2 > Line3 > etc. > > Member 2: > Line 1 > Line 2 > Otherkw(val) Otherkw2(val) LONGKEYWORD2(longvalu) Otherkw3(val) > etc. > > Member 3: > Line 1 > Otherkw1(withitslongvalue) LONGKEYWORD2(valu) > Line 3 > etc. > > Member 4: > Line 1 > Line 2 > Line 3 > Line4 > KW(val) Anotherkw(anditsvalue) Alongkeywordhere(withalongvalue) > KEYWORD1(va) > etc. > > This would create the output (either in a single MOD file, or separate > files I can put together myself: > VAL.KEYWORD1.D20200527 > LONGVALU.LONGKEYWORD2.D20200527 > VALU.LONGKEYWORD2.D20200527 > VA.KEYWORD1.D20200527 > > Can something like this be done in a DFSORT step? If not, I can write > the various utilities myself in Rexx and/or COBOL, so you don't need to > suggest that. > > Thanks for your help once more! > Billy > > ---------------------------------------------------------------------- > For IBM-MAIN subscribe / signoff / archive access instructions, > send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN > ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN