You can take all the DCB info off your output datasets. DFSORT can supply all that for you, with no possibility of a clash if something changes (or two places to make the same change).
It may look like it works, but all your output records are 9004 bytes long. If they are full of data, why make it a V-type file? If they are not full of data, consult the documentation and see what VLTRIM on OUTFIL can do for you.
Since your two OUTFIL's are mutually exclusive, you can use SAVE instead of one of the tests.
It was not BUILD that was the problem, it was the 9004. Please change the OUTRECs back to BUILDs.
Ah. Now noting your title and your opening paragraph.
You have a V-type file and you want to add a piece if information temporarily, use it in OUTFIL to direct the processing, and then forget about it.
With variable-length records it is much better to prepend rather than append temporary data:
Code:
REFORMAT FIELDS=(F1:1,4,?,F1:5)
That keeps the records variable (the 1,4), puts the match-marker first and then the data from position five to the end of the actual record.
Code:
OUTFIL ...,BUILD=(1,4,6)
That recreates your original record. The lonely six does "byte six to the end of the record" and your match-marker has disappeared.
The reason why i need in vb and in a specfic format is because, The input file is an production one and we are removing some of the record from the input file. after we remove the problamatic record, we need to replace the input file with our file created. We cannot change format/layout of the file. It is has to be in the same format, only the problamtic records to be removed and the problamtic record are in File2.
Will there be any garbage bytes added since the reformat is FB ? i.e Sort read as VB and convert it to FB and i am converting again back to VB.
Because not all records are having same length, it varies.
I wrote some stuff then looked again at your title, and then the post, so for your question, read from "Ah. Now noting your title and your opening paragraph."
The REFORMAT RECORD I showed copies the RDW, inserts the Match Marker, then copies only the data from the current variable-length record. The later BUILDs strip out the Match Marker and return the record to its original state, with its original length, and with only its original data and nothing else. You don't need the FTOV as there is no need to make it F in the first place.
I dont know, how make the join in VB, Please find the below error
Code:
* CONTROL STATEMENTS FOR JOINKEYS APPLICATION
JOINKEYS FILE=F1,FIELDS=(5,29,A),SORTED,NOSEQCK
JOINKEYS FILE=F2,FIELDS=(1,29,A)
JOIN UNPAIRED,F1
REFORMAT FIELDS=(F1:1,4,?,F1:5,9000)
* CONTROL STATEMENTS FOR MAIN TASK (JOINED RECORDS)
SORT FIELDS=COPY
OUTFIL FNAMES=MATCH,INCLUDE=(5,1,CH,EQ,C'B'),
BUILD=(1,4,6,9000)
OUTFIL FNAMES=UNMATCH,INCLUDE=(5,1,CH,EQ,C'1'),
BUILD=(1,4,6,9000)
ICE411I 0 THIS IS THE JOINKEYS MAIN TASK FOR JOINING F1 AND F2
ICE416I 0 JOINKEYS IS USING THE F1 SUBTASK FOR SORTJNF1 - SEE JNF1JMSG MESSAGES
ICE416I 1 JOINKEYS IS USING THE F2 SUBTASK FOR SORTJNF2 - SEE JNF2JMSG MESSAGES
ICE419I 0 JOINED RECORDS: TYPE=F, LENGTH=9005
ICE201I H RECORD TYPE IS F - DATA STARTS IN POSITION 1
ICE043A 9 INVALID DATA SET ATTRIBUTES: MATCH RECFM - REASON CODE IS 14
ICE751I 0 C5-K90025 C6-K90025 C7-K54603 C8-K62201 E9-K60823 E7-K62201
ICE052I 3 END OF DFSORT
Below code works,
Please advice will there be a garbage byte added in the below code, or please advice how do we identify a garbage value is added or not ?
Code:
//SYSIN DD *
* CONTROL STATEMENTS FOR JOINKEYS APPLICATION
JOINKEYS FILE=F1,FIELDS=(5,29,A),SORTED,NOSEQCK
JOINKEYS FILE=F2,FIELDS=(1,29,A)
JOIN UNPAIRED,F1
REFORMAT FIELDS=(F1:1,4,?,F1:5,9000)
* CONTROL STATEMENTS FOR MAIN TASK (JOINED RECORDS)
SORT FIELDS=COPY
OUTFIL FNAMES=MATCH,INCLUDE=(5,1,CH,EQ,C'B'),FTOV,
BUILD=(6,9000)
OUTFIL FNAMES=UNMATCH,INCLUDE=(5,1,CH,EQ,C'1'),FTOV,
BUILD=(6,9000)
/*
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum