Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
Ramsee,
Please answer the following questions
1. Does every group start with 'ABC'?
2. Is it always 3 records per group?
3. What is the LRECL and RECFM of the input file?
4. Please run the following JCL and show us the sysout which helps us to determine the level of DFSORT you running.
Hi Skolusu,
The file is of VB Format with 22900 as record length, the DEF may occur as any record(Not restricted to second) within the group.
Please find the SYSOUT Display
1ICE201I H RECORD TYPE IS F - DATA STARTS IN POSITION 1
ICE751I 0 C5-K62149 C6-K90026 C7-K58148 C8-K67572 E9-K60824 C9-BASE E5-K72040
ICE143I 0 BLOCKSET COPY TECHNIQUE SELECTED
ICE250I 0 VISIT www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES A
ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R12 - 18:50 ON TUE O
0 OPTION COPY
ICE201I H RECORD TYPE IS F - DATA STARTS IN POSITION 1
ICE751I 0 C5-K62149 C6-K90026 C7-K58148 C8-K67572 E9-K60824 C9-BASE E5-K72040
ICE193I 0 ICEAM1 INVOCATION ENVIRONMENT IN EFFECT - ICEAM1 ENVIRONMENT SELECTED
ICE088I 0 NNPR3TOA.S1 . , INPUT LRECL = 80, BLKSIZE = 80, TYPE = FB
ICE093I 0 MAIN STORAGE = (MAX,6291456,6278238)
ICE156I 0 MAIN STORAGE ABOVE 16MB = (6200798,6200798)
ICE127I 0 OPTIONS: OVFLO=RC0 ,PAD=RC0 ,TRUNC=RC0 ,SPANINC=RC16,VLSCMP=N,SZERO=Y
ICE128I 0 OPTIONS: SIZE=6291456,MAXLIM=1048576,MINLIM=450560,EQUALS=N,LIST=Y,ER
ICE129I 0 OPTIONS: VIO=N,RESDNT=ALL ,SMF=NO ,WRKSEC=Y,OUTSEC=Y,VERIFY=N,CHALT
ICE130I 0 OPTIONS: RESALL=4096,RESINV=0,SVC=109 ,CHECK=Y,WRKREL=Y,OUTREL=Y,CKPT
ICE131I 0 OPTIONS: TMAXLIM=6291456,ARESALL=0,ARESINV=0,OVERRGN=65536,CINV=Y,CFW
ICE132I 0 OPTIONS: VLSHRT=N,ZDPRINT=Y,IEXIT=N,TEXIT=N,LISTX=N,EFS=NONE ,EXIT
ICE132I 0 OPTIONS: VLSHRT=N,ZDPRINT=Y,IEXIT=N,TEXIT=N,LISTX=N,EFS=NONE ,EXIT
ICE133I 0 OPTIONS: HIPRMAX=OPTIMAL,DSPSIZE=MAX ,ODMAXBF=0,SOLRF=Y,VLLONG=N,VSAM
ICE235I 0 OPTIONS: NULLOUT=RC0
ICE236I 0 OPTIONS: DYNAPCT=10 ,MOWRK=Y
ICE084I 0 BSAM ACCESS METHOD USED FOR SORTOUT
ICE084I 0 BSAM ACCESS METHOD USED FOR SORTIN
ICE751I 1 EF-BASE F0-K66717 E8-K70685
ICE090I 0 OUTPUT LRECL = 80, BLKSIZE = 80, TYPE = FB
ICE055I 0 INSERT 0, DELETE 0
ICE054I 0 RECORDS - IN: 1, OUT: 1
ICE052I 0 END OF DFSORT
Ramsee,
You still have not replied for Skolusu's questions 1) and 2). Without that, you will not get any help here.
Reg 4) Its enough if you post the 1st line of what you have pasted from your SYSOUT here.
Its always good if you tell us the DFSORT level of your site when you post a query. How to determine that can be seen in:
ibmmainframes.com/viewtopic.php?t=33389
In the above IF DEF is present we have to write the Group into the file, DEF may present anywhere in the group starting position is 5to7(VB file).
All the Group starts with ABC.
Here the data droup starts with the DCST and always ends with DCTA
I need to extract the Group into a file with having "DCSA" witin the Group.
DCSA may present in any of the occurance within a group or it may have duplicates as well.
single output file should contain as follows
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
OK.
Have a look at the technique with JOINKEYS where you specify the same dataset for both files (many examples here).
In JNF2CNTL you can ignore all except your group definers (if you are not validating, then you only need the header) and the particular data record you want.
Define a GROUP with an ID. If a header, append a value of zero. If data append a value of one.
You only need the ID and the appended value in your output.
SUM on the appended value, so you only get one record per ID.
In the JNF1CNTL apply the same GROUP to get the ID.
Then JOINKEYS on the ID (all must match) and if the F2 has the value "1" then you need to write the group out, else you don't (which can be INCLUDE/OMIT in the COPY step after the JOIN.