Page 1 of 1

Sort comma delimited data

PostPosted: Mon Apr 07, 2014 1:17 pm
by Subbarao
Hi All,

I want to sort a PS file, which is comma delimited file, Here is the sample data, and i want to sort according to the first column.

123456789,Aus,Jeffa,Sydney
12345,Texas,John Doe,San
234,NJ,Joe,Mexico
678892,IN,Abdul Dariff,Delhi

I should get,

234,NJ,Joe,Mexico
12345,Texas,John Doe,San
678892,IN,Abdul Dariff,Delhi
123456789,Aus,Jeffa,Sydney

Please gimme a JCL, Thank you in Advance.

Re: Sort comma delimited data

PostPosted: Mon Apr 07, 2014 1:31 pm
by NicC
Please gimme a JCL

This is just plain rude - even with the 'please'. You are demanding that we do your work for you. The sort JCL is very simple and is shown in the manual which you can easily read. If, however, you are wanting sort control cards then you should show us what you have tried and how it did not give the results that you wanted. Also, for control cards you should have posted in the section of the forum applicable to your sort program. As control cards can vary between sort products you should be clear as to which product you use (hint: read the SYSOUT not the PGM=).

Also, when coding data, JCL, program code, control cards, anything requiring the preservation of format including spaces you must use the code tags.

I will move this to the DFSort part of the forum - if you are using another product then please let us know which and it will be moved there.

Re: Sort comma delimited data

PostPosted: Mon Apr 07, 2014 2:28 pm
by BillyBoyo
You should use PARSE, with FIXLEN for the maximum length of the first field, then extend your record temoprarily (in INREC) to include the PARSEd field at a fixed position, SORT on that new field, then remove the new field in OUTREC or OUTFIL.

It looks like you need right-aligned data for your sort, so look at JFY with SHIFT=RIGHT as well.

Re: Sort comma delimited data

PostPosted: Thu Apr 10, 2014 12:59 am
by steve-myers
You are asking for the work product of a professional. Professionals expect to be paid. If you are interested in paying a professional, leave a message here and someone may contact you using the private mail facility of this forum. Please be patient; few people seem to be willing to pay, so it may be some time before a qualified professional willing to perform this task will read your post.

Re: Sort comma delimited data

PostPosted: Thu Apr 10, 2014 3:54 am
by skolusu