Hi All,
I am having a sequential file which I am recving from 3rd Party. Record Count is varying daily. May possible for some day we may recieve 1 record, next day we may recieve 1000 records. One thing is sure, File will always have "EOF" Char. Below is my requirment. All records except "EOF" char. is termed as Valid Record.
1. If a File is having only 1 Record & Starting from Position = 1 & Length = 3, we have Char like 'EOF' then Need to set the Return Code = 4.
2. If File is having more than 1 Records & last Record is having Char as 'EOF' Starting from Position = 1 & Length = 3. All records except Char 'EOF' Should get written to an O/P file.
Example: 1. File Having 6 Valid Record.
123456|3456789|ABCDEFVHJK1234|.............. --> Written To O/P File
444446|3789765|ABCDEFVHJK1234|.............. --> Written To O/P File
123456|3456789|ABCDEFVHJK1234|.............. --> Written To O/P File
123456|3456789|ABCDEFVHJK1234|.............. --> Written To O/P File
123456|3456789|ABCDEFVHJK1234|.............. --> Written To O/P File
123456|3456789|ABCDEFVHJK1234|.............. --> Written To O/P File
EOF --> Should NOT get Written To O/P File.
Exmple: 2. File Having only 1 Valid Record.
123456|3456789|ABCDEFVHJK1234|.............. --> Written To O/P File
EOF --> Should NOT get Written To O/P File
I/P & O/P file having attributes as LRECL = 3132 & Recfm = FB. How this can be done using SORT.
Thanks
KInd Rgd's