Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
It's not clear what you want to do or what your data actually looks like.
Are the fields in fixed positions, or are they delimited in some way.
Please show a better example of the records in your input file and what you expect for output. Explain the rules for getting from input to output. Give the RECFM and LRECL of the input file. Give the starting position, length and format of the relevant fields, or explain how the fields are delimited if appropriate.
Joined: 14 Jul 2010 Posts: 13 Location: United States
Input file is Lrecl- 70. It has Group name - position 1,70.
Few Group are associated with an association and have the association initials at the beginning of the name seperated by '/'.
Following is an example.
GROUP NAME 1
GROUP NAME 2
AAAA/GROUP NAME 3
BBB/GROUP NAME 4
CC/GROUP NAME 5
GROUP NAME 6
.
.
.
My output should be of lrecl = 70
GROUP NAME 1
GROUP NAME 2
GROUP NAME 3
GROUP NAME 4
GROUP NAME 5
GROUP NAME 6
.
.
.
I came up with the following -
But this is with an assumption that the association Initials can be of max 6 bytes. This is true for almost all the cases os of now, but there is no check on the length, hence wanted a generic soln.