Posted: Tue Dec 30, 2003 10:46 am Post subject: Convert Character field to ZD
Hi,
Is it possible to convert CH field to ZD using SYNCSORT ?. I have a file
with length 1000 and a field at position 13 with length 5 and format CH.The field is having trailing spaces.So when I sort this key field the output records are not following the expected sequence. Do I need to convert this field to ZD before sorting or is there any turaround? Pl advice.. _________________ Regds,
Somu
Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Tue Dec 30, 2003 11:19 am Post subject:
Somu,
I don't think conversion to ZD fields will solve the problem. Since you have trailing spaces, you need to format them to either right align or left align. since the field length is only 5 we can easily reformat it and then sort it.
As always please post a sample input data and expected output.
Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Sun Jan 04, 2004 11:57 am Post subject:
Somu,
The following JCL will give you the desired results. A brief explanation of the job. The first copy operator splits the input file into 5 temp files based on the no: of spaces on each record in the field in question(13,5). While splitting we also right align the field so that the sorting on the field will give the desired results. The second copy operator will combine all the 5 temp files and sort on the field in question. I haven't tested it, so bear with me for any syntax errors.
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