I have a VB file (LRECL=2199, RECFM=FB) where first two bytes on each record have got length. My requirement is to convert this file to another VB file but excluding the first two bytes, ie., I need to copy the content into another VB file of LRECL 2197 but excluding 1st two bytes. Also, the RDW should have updated length in it. Is this possible with SORT?
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
Quote:
Since first two bytes should be removed, I think it should lessen 4 bytes from RDW !
I sure hope you mean 4 should be subtracted from the length of the record stored in the RDW, because otherwise you've got a problem -- an RDW is 4 bytes, ALWAYS! The first two bytes store the record length and the second two bytes are reserved for use by the system.
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
Ramsri,
Follow what Nic says. On the 4, as Robert points out, you have confused yourself.
Code:
INREC BUILD=(1,4,7)
For a VB you always have to place the RDW from the input record to the output record if you are going to change a length (using BUILD or FIELDS). The "7" above says "byte 7 to the end of the current record, whatever that actually is".
SyncSort will then take care of having the correct value in the RDW.
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
Without having seen what you are about to post - if you are specifying LREC,BLKSIZE and/or RECFM on your SYSOUT DD statement - don't! Sort will take care of that for you.
When MicroFocus makes a VB file, the RDW is two-bytes. That may be the source of this file. There is a mainframe utility caled VRECGEN that biulds files that look like this example.
Also, someone may have gotten overzealous in building the LLZZ parts of a GSAM output file and included it in the data portion.
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
Ramsri,
You only seem to be showing two bytes of "stuff" before the data starts. The RDW (Record Descriptor Word) is four bytes long (that's the "Word" bit, a "Word" being four bytes).
The first two bytes of the RDW are the record-length. The next two bytes are the IOCS and don't get used much (spanned records) so are usually binary zeros.
Ed has made a couple of suggestions. Do they apply in any way to you?
EDIT: The hex values you have at the start of the record don't make sense. 19000+ Please describe where you get the input from, and try to do a hex print including the RDW.
Is this without the RDW? Ie just the data, and the first two bytes are what you want to exclude?
Did you then run the Sort card I asked for the input or the output file? I asked for both. Did you still run it with "5" not "7" or "9"?
Have you run the (1,4,7) for your input file, creating an output file, and still have bytes 5 and 6 from the input?
If you run the BUILD with (1,4,7) on that input, assuming the RDW is not shown, then your two characters should disappear and the record-length in the RDW should be adjusted by Syncsort.