Posted: Wed Apr 19, 2006 6:06 am Post subject: Right Justify a field using SYNCSORT/File-Aid.
Hi,
I have a dataset with content shown as following.
Code:
***************************** Top of Data ******************************
----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
1234 AAAA 1AXAASKLFJKLASFR20394023402340230AFXCLLASDFL03933
**************************** Bottom of Data ****************************
I want to right jusity the "AAAA" (not only this but several other records) while copying it to output dataset.
Code:
***************************** Top of Data ******************************
----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
1234 AAAA 1AXAASKLFJKLASFR20394023402340230AFXCLLASDFL03933
**************************** Bottom of Data ****************************
How to do it using the SYNCSORT/File-Aid.
Please post both the solutions if you have idea. TIA. _________________ MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
Kolusu, Thanks a lot. It seems to be a very difficult task. I need to be very careful while modifying the solution provided by you to suit my requirement.....
If I won't succeed then I will go for a COBOL program........ 8)
Thanks a lot. _________________ MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
Thanks for you extreme help. Actually, I solved the problem like explained below:
I declared the record layout in the WS and I declared a variable with "RIGHT JUSTIFIED". I kept the first and last bytes as filler and moved the entire record to this new structure and rewritten the output file by opening the file in I-O mode. I know that this is only temporary solution what I've worked out. The reason behind that was because I get the characters as "AAAA" or "BBBB" or "CCCC" like that. So, it made my work easier.
One more solution I found was making use of REVERSE function available in COBOL. This has also worked for me because my incoming data has repetitive characters.
Please let me know if my approach was wrong.
Once again thanks for your help buddy. _________________ MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
I got what would be the limitation of the solution I've worked out. It does not work for the fields defined as Numeric data items. In this case the solution and links provided by KOLUSU will be very handy for anybody.
Please let me know if my understanding is wrong.
Thanks. _________________ MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
Thanks for your effort. _________________ MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Wed Apr 26, 2006 3:22 pm Post subject:
I know the request here was for a Syncsort or FileAid solution, but the new JFY function of DFSORT available with the April, 2006 PTFs make this so much easier to do with DFSORT, that I couldn't resist showing that solution:
Alas, why we don't have DFSORT !! _________________ MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum