Joined: 07 Apr 2010 Posts: 94 Location: Bangalore, India
Your post helps.
Just an add on to my requirement, I need to filter my output files based on the last character - if it is A,U it should go to ADD output file and if it is D, it should go to DELETE file
Please correct my understanding, if on a wrong track:
1) Use INREC IFTHEN WHEN INIT - JFY=RIGHT, LENGTH = MAX LENGTH
2) OUTFIL FILES=ADD,INCLUDE=(MAX-LENGTH,1,CH,EQ,L(C'A',C'U')),
IFTHEN WHEN INIT, BUILD=(1, MAXLENGTH - 2, JFY=LEFT),
3) OUTFIL FILES=DEL,INCLUDE=(MAX-LENGTH,1,CH,EQ,L(C'D')),
IFTHEN WHEN INIT, BUILD=(1, MAXLENGTH - 2, JFY=LEFT)
OK, I've discovered what VL means (a variable-length field with trailing blanks dropped) and that it only works on OUTFIL with FTOV.
That doesn't mean you just add FTOV onto OUTFIL to make the VL work. FTOV converts Fixed-length-record TO Variable-length-records. So you'd need to have fixed-length input you wanted as variable-length output. So you can't use FTOV here, so you can't use VL on JFY. In this case it will make the JFY not do what you want, even if it did "work".
When you want to drop the last two, use 5,44 in the final BUILD.