I have below data in file of record length 25 bytes.
I would like to remove the constant character 'ABCDE' from Detail record reducing the overall file length from 25 byte to 20 byte but would like to keep the HEADER and 9TRAIL as such
Standard question for newcomers: What did you try so far?
Try to do it STEP-BY-STEP.
First, ignore your requirement on leaving untouched header and footer, and train yourself: how to remove a part of a record, without truncation of physical LRECL?
Next, train yourself: how to truncate the physical record length after removing its part?
Finally, find out: how to leave your header and footer untouched?
Never try to resolve any complex task in one shot!!!
Never ask others to do your own job for you, from start to finish!!!
Why VB ? If it’s FB 25 then on the way out just build for FB 20..
There are many easy way to solve this but one that I can say -
If it’s always first five positions then use IFTHEN CONDITION to check if it’s’ABCDE’ then BUILD ONLY FROM 6,20 otherwise BUILD (1,20)..
Wouldn’t that work ?
The header and trailer must remain 25 characters, isn’t it?
Besides, after removing 5 chars from a record I expect not to append 5 blanks at the end of updated record, but make it exactly 20 bytes long.
Yes, the total file length should be 20 bytes.
We can see that the Header and Trailer comes within this 20 byte length and so no issues.
I have tried like this and it works but got puzzled how it works.
if I remove the last stetement IFTRAIL=(HD=YES,TRLID=(1,6,CH,EQ,C'9TRAIL')) , the Header gets truncated