I have a file with a name last name, first name, followed by some other data, need to split the name field into 2 fields last name and first name, the name field itself is fixed.
Code:
=COLS> ----+----1----+----2----+----3----+----4----+---
000008 0 000003401 ADAMS, MARIA R. CX A
000009 000004440 WADE, MAUREEN YVETTE CX A
000010 000011500 ALFARO, CARMEN MERCEDEZ CX A
So the name fiels starts at 16, and ends at 43. Just need the parse statement to create the 2 fields last name and first name
I am expecting 2 fixed fields one with the last name and one with the first name. I know how to include the parsed fields in a build statement, just not sure how to construct the 2 parsed fields.
My difficulty is that there is could be an embedded space in the first name, so not sure how to get the parse to stop in the correct place, ideally I could have it search just the positions taken up by the entire name, but that does not seem to be an option.
Thanks, I didn't mention that I needed to create an output file which splits many other fields from a report into a tab-delimited file. You solution gave me the idea to just add the name field at the end of the inrec, and then apply your parse command to the extra field and include them in the outrec, which work fine. The final sort statment is as follows