Joined: 02 Jan 2009 Posts: 115 Location: Hyderabad
I have the below vb file
First 5 bytes are flags and next set is data related to the flags. If a flag is set to 0, there will not be any detailed information. Say Flags A thru E. Detailed info length of flags A thru E are 3,5,10,15,20 bytes respectively.
Now, I have an assembler program to expand this input file based on flags and filling the information with spaces when flag is set to 0.
Output would be
01101 BBBBBCCCCCCCCCC EEEEEEEEEEEEEEEEEEEE
Can this be done using DFSORT?
I am thinking this way - inrec if 1st byte is 0, overlay 6:3x with right shift (I had findrep right shift in mind). And so on... with hit=next and other conditions. Later I realized there is nothing like right shift for overlay.
Even if we have a way to right shift the data while inserting, does the next ifthen take the latest inrec updated by previous ifthen?
I could have gone for different combinations of these flags and writing inrec overlay. But the flags are more in number (15 flags).
Please advise if there is a way to do. I searched the forum for key words "insert shift", "right shift" etc. But only found right shift for sqz and findrep.
If you have 15 flags, you'll need 15 IFTHEN=(WHEN=(logicalexpression) each (except the last) with HIT=NEXT.
You won't be able to use OVERLAY, because it works directly on the existing current record. You will trash your data in no time. BUILD always creates a new current message, so you'd need BUILD.
Doing up to 15 BUILDs has some overhead per record has some overhead. If you have a lot of data to do this to, you may want to knock together a quick E15 or E35 sort exit (examples in the manual) as well, and compare the two.