jegan_selvan,
Your expected output for HEADER and detail records doesn't match for trailing space. For example, for the detail record your expected output shows trailing space "BBBBBBBBB " but the same is not true for header"FULL NAME".
Making some assumption about output field length (you can adjust fields to match your expected output of FB200). Here is one way to do it. See if this helps..
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
jegan_selvan,
The following DFSORT JCL will give you the desired results. I assumed you also have the header record(1st record) in the file. If you don't have that header just remove the ,skiprec parm after copy parm
Thanks for your reply. It helped me a lot to solve the issue. But i have one small change in the requirement.
Actually the full name is not ending with space for all the records.
The Record 4 and 5 is not having spaces after their last name.
So these records are not formatting properly.
Output is coming like this
Code:
********************************* TOP OF DATA ***************************
"AAAAAAAA","AAAAAAAA","SAM,KRISTIEN X","KRISTIEN","SAM","X"
"BBBBBBBBB","BBBBBBBBB","VISHALI,SELVAN ","SELVAN","VISHALI"
"CCCCCCCCC","CCCCCCCCC","KANNAN,SENTIL VARMAN","SENTIL","KANNAN","VARMAN"
"DDDDDDDD","DDDDDDDD","JAYAN,VARMAN|2011| ","VARMAN|2011|","JAYAN"
"EEEEEEEEEE""EEEEEEEEEE""NEELAN,KUNAL|2011| ","KUNAL|2011|","NEELAN"
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
jegan_selvan,
well you haven't explained the rules clearly. Looks you have changed the control cards to include additional data as your output shows 2011 which is not even present in the input. Please provide detailed/complete information on what you're trying to accomplish. Do not make people guess what you mean. This will give you a much better chance of getting a good answer to your question.
jegan_selvan wrote:
The Record 4 and 5 is not having spaces after their last name. So these records are not formatting properly.
It is a simple change . change the following lines in my post