I have the following requirement
Input file: LRECL:10
The space you see in the records are deliberate and not typo. The field in the input file might vary in length, i need all the fields within single quotes followed by a comma except for the last record(last record will have single quotes but should exclude comma and include a closed bracket ')')
Expected Output: LRECL:13
Sort card i used is as follows:
The output i am getting:
Issues with the above output:
1. When there is a space in the first position of the field(last record) it is getting shifted left as i have left justified, but i want the first character to be space(as input) in the output.
2. I was not able to remove the comma in the last record.
3. I am getting a repetition of the last record, as i have used TRAILER1 function. If possible, i want to avoid this, though it is harmless.
Can someone please help me with this?