I have a requirement where i need to eliminate certain records from the input VB file (lrecl - 9072) and write it to a new file with the trailer count updated.
I got the following error message:
WER108I SORTIN : RECFM=VB ; LRECL= 9072; BLKSIZE= 23476
WER257I INREC RECORD LENGTH = 9077
WER238I POTENTIALLY INEFFICIENT USE OF INREC
WER237I OUTREC RECORD LENGTH = 9072
WER110I SORTOUT : RECFM=VB ; LRECL= 9072; BLKSIZE= 23476
WER410B 7,848K BYTES OF VIRTUAL STORAGE AVAILABLE ABOVE THE 16MEG LINE,
WER410B 0 BYTES RESERVE REQUESTED, 2,207,192 BYTES USED
WER055I INSERT 0, DELETE 0
WER244A INREC - SHORT RECORD
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
PS:
I have made a search on this forum regarding this but did not find much useful info.
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
Code:
INREC FIELDS=(1,4,5:5,9068,
9073:SEQNUM,5,PD)
Suresh,
VB files should n't be padded at the end like fixed length files. By doing so, you just lose the indidual record lengths. If you want to attach some identifier to a VB file, always insert it at the beginning of the record immediately after the RDW field.
The above code still has some issues with the trailer count field. The trailer count field in input file is defined as PD and is of 5 bytes in length. But now the updated trailer count occupies 8 bytes instead of 5 bytes in the output file. The value of trailer count in both the input file and output file is shown below :
Input File (HEX ON):
Code:
...h.
00283
0068C
Output File (HEX ON):
Code:
........
00000213
0000076C
Kindly help me on this.
Thanks,
Suresh
Edited: Please use BBcode when You post some code/error, that's rather readable, Thanks... Anuj
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
Hi sureshkumar_p01,
I try to eidt your code but not sure what is that "h" in your input, is that really a part of your input? And yes please show some sample input and expected output with rules to get better replies. When you post your input and output please use BBcode.
My aim is to achieve the following things using the above code:
1. Remove all records which has 180 in position 14,3.
OMIT COND=(14,3,CH,EQ,C'180')
2. Add a SEQNUM in position 25 which will be used to update the trailer count.
INREC FIELDS=(1,4,5,20,25:SEQNUM,5,PD,30:25)
3. My file has 5 header and 5 trailer records. And i want to update the second trailer record. The reason to update this particular trailer is because this is the one which contains the count of records which has '180' in position 14,3 which we have omitted. That is why i substract 7 from the SEQNUM.
BUILD=(1,4,5,20,25:(25,5,PD,SUB,+7),PD,41:35,9026))
4. i want the trailer count to be displayed in PD format and of length 5 in the output file. But the trailer count field in the second trailer record of output file is of 8 bytes instead of 5 bytes.
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
Quote:
3. My file has 5 header and 5 trailer records. And i want to update the second trailer record. The reason to update this particular trailer is because this is the one which contains the count of records which has '180' in position 14,3 which we have omitted. That is why i substract 7 from the SEQNUM.
BUILD=(1,4,5,20,25:(25,5,PD,SUB,+7),PD,41:35,9026))
If your input trailer is already having a count, why dont u try subtracting '7' from the existing count field in the trailer. Why would you need a SEQNUM to count it again? Let me know if I am missing something.
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
Hello,
Suggest you to post rather complete sample input, expected output & rules along with LRECL & BLKSIZE of input output. What you are trying may be a way to achieve what you want but it's not working for you now - for us to help you it's better we know what is being expected.
You say
Quote:
My file has 5 header and 5 trailer records. And i want to update the second trailer record.
but your sample input shows only one (probably "h" was to show header). I again say, showing rather complete sample input, expected output & rules along with LRECL & BLKSIZE of input/output might fetch better answer else we'll just guesstimate.