ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01,
JOINKEYS FILE=F1,FIELDS=(29,27,A)
JOINKEYS FILE=F2,FIELDS=(29,27,A)
JOIN UNPAIRED,F1
REFORMAT FIELDS=(F1:1,4,?,5)
£
ICE007A D SYNTAX ERROR
my updated SORT code is:
Code:
//SYSIN DD *
JOINKEYS FILE=F1,FIELDS=(29,27,A)
JOINKEYS FILE=F2,FIELDS=(29,27,A)
JOIN UNPAIRED,F1
REFORMAT FIELDS=(F1:1,4,?,5)
SORT FIELDS=COPY
* 'B' EXTRACT RECORDS FOUND IN BOTH THE FILES
OUTFIL FILES=01,INCLUDE=(5,1,CH,EQ,C'B'),BUILD=(1,4,6)
* '2' EXTRACT RECORDS FOUND IN FILE 2 BUT NOT IN 1
OUTFIL FILES=02,INCLUDE=(5,1,CH,EQ,C'2'),BUILD=(1,4,6)
/*
//JNF1CNTL DD *
INCLUDE COND=(56,2,CH,EQ,C'11',&,68,1,CH,EQ,C'Y')
/*
//JNF2CNTL DD *
OPTION COPY
/*
I guess that every record header / detail has the key
Key is on p=25,l=27
I guess also that the
p=52,l=2,CH,value '11' and p=62,l=1,CH value'11'
occurs in the header
if the above is true
and You can distinguish the header from the other records
the clauses GROUP, PUSH, OMIT, BUILD should be enough to provide the desired output.
why not post a simplified example just the significant fields
( the key can be shorter to save some typing )
I guess that every record header / detail has the key
Key is on p=25,l=27 - Yes
I guess also that the
p=52,l=2,CH,value '11' and p=62,l=1,CH value'11'
occurs in the header - Yes
if the above is true
and You can distinguish the header from the other records
the clauses GROUP, PUSH, OMIT, BUILD should be enough to provide the desired output. - Sure
why not post a simplified example just the significant fields
( the key can be shorter to save some typing ) - See below
input and expected output !
Input:
Code:
NWBNAB11 6BX 00000000G4098168000000575823675335021111 D MR C MIC
NWBNAB11 6BX 00000000G4098168000000575823675335021212 201AB11 6B
NWBNAB11 6BX 00000000G40981680000005758236753350222000000001DThe amoun
NWBNAB11 6BX 00000000G4098175000000575849000000001111 DYMR J MIC
NWBNAB11 6BX 00000000G4098175000000575849000000001212 201AB11 6B
NWBNAB11 6BX 00000000G40981750000005758490000000021000000001Transactio
Output1
Code:
NWBNAB11 6BX 00000000G4098168000000575823675335021111 D MR C MIC
NWBNAB11 6BX 00000000G4098168000000575823675335021212 201AB11 6B
NWBNAB11 6BX 00000000G40981680000005758236753350222000000001DThe amoun
ICE250I 0 VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES AN
ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R12 - 13:23 ON MON NO
INREC IFTHEN=(WHEN=GROUP,BEGIN=(56,2,CH,EQ,C'11',&,
68,1,CH,EQ,C'Y'),
PUSH=(436:56,2))
OPTION COPY,VLSHRT
OUTFIL FNAMES=SORTOUT1,INCLUDE=(436,2,CH,EQ,C'11'),
BUILD=(5,431)
OUTFIL FNAMES=SORTOUT2,BUILD=(5,431),SAVE
ICE201I H RECORD TYPE IS V - DATA STARTS IN POSITION 5
ICE150I 0 VLSHRT NOT USED FOR SORT, MERGE, INCLUDE, OMIT OR SUM STATEMENT FIELDS
ICE251A 9 MISSING RDW OR DATA FOR SORTOUT1: REASON CODE 03, IFTHEN 0
ICE751I 0 C5-K62149 C6-K90026 C7-K58148 C8-K67572 E9-K60824 E7-K70685
ICE052I 3 END OF DFSORT
I always struggle in SORT card when input is a VB file. Please advice.
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
When temporarily "extending" a record with PUSH/OVERLAY/BUILD, if the record is fixed in length, you do it at the end of the record. If the record is variable in length, you do it at the beginning, to avoid making all the records a fixed-length in a VB dataset.
Code:
BUILD=(1,4,20X,5)
This will take the RDW from the original file (all you need to do, DFSORT will do the adjustments to it), makes 20 bytes of space to be overlayed/pushed late and copies from position 5 until the end of the current record.
In your code, you have missed out on the RDW (the problem you know about) and have made all the records the same length (a problem you don't yet realise).
is not working, specially first part. For some reason, it is including record even it has space.
Code:
NWBNAB11 6BX 00000000G4098175000000575849000000001111 DYMR J MIC
NWBNAB11 6BX 00000000G4098178000000575849000000001111 DYMR J MIC
NWBNAB11 6BX 00000000G4147967000000575849000000001111 S MR J MIC
Third record shouldn't have appear on SORTOUT1 file.
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
You are defining a group of records. The way you are defining it, all records are in a group once the first group definition is located and until the next group definition is located.
If you have something which "ends" the group of records, you can specify that on the IFTHEN.