Page 1 of 1

Reformatting a Variable length file

PostPosted: Fri Dec 31, 2010 12:29 pm
by mfguy
Hi ,

I have a requirement here. I am having a VB(Variable Length) file which has first 4 digits as binary. Using sort option i have to reformat the 4 digits in the i/p file to a 9 digit Zoned Decimal in the O/P file. The O/p file is also a VB(Variable Length) file. Please help me out in this. I can achieve this if the O/P file is a Fixed length file.
But couldn't get how to achieve this for a VB file.

Thanx in advance

Re: Reformatting a Variable length file

PostPosted: Sun Jan 02, 2011 12:41 am
by Frank Yaeger
It's not clear from your description what your input records look like.

For a VB record, the first 4 bytes would be the RDW which has the length as binary in the first 2 bytes.
You say "which has first 4 digits as binary". What does that mean? Do you mean positions 5-8 (after the RDW) are binary or do you mean something else - you need to be specific. It would help if you'd show an example of what your input records look like in hex, and what you expect for output.

Re: Reformatting a Variable length file

PostPosted: Mon Jan 03, 2011 12:40 pm
by mfguy
Hi Frank,

I mean the binary digits after RDW of a VB file. The Binary digits are in the position 5-8. The O/P dataset shld have the ZD value(length 9)
of the binary digits in postion 5-8 of the i/p file. The O/P file should also be a VB file.

Please find the Hexadecimal value of an input record

                .....@31.10.1995..
                020007FF4FF4FFFF00
                01009C31B10B199501


The expected O/P shld have 210000097 in 1-9 position of the O/P file(V/B file).

Re: Reformatting a Variable length file

PostPosted: Mon Jan 03, 2011 10:55 pm
by Frank Yaeger
Sigh. How can you expect me to help you when you can't describe accurately what you want?

.....@
020007
01009C


Assuming you aren't showing the RDW, I see X'00' in position 5 and X'210000097C' in positions 6-10 which is a PD value, so how does this match your description of "The Binary digits are in the position 5-8"? Please accurately describe what you want.

The expected O/P shld have 210000097 in 1-9 position of the O/P file(V/B file).


I assume you mean 5-13 position? Are you dropping the leading 00 from the X'00210000097C' PD value or what?

I can easily show you how to do this kind thing in DFSORT, but only if I actually know what it is you want to do, which you're making difficult.