Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Sort After 1 rec

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
dp33770

New User


Joined: 04 Jul 2007
Posts: 92
Location: Hyderabad

PostPosted: Wed Dec 10, 2008 11:07 am    Post subject: Sort After 1 rec
Reply with quote

I have a file in which 1st rec. is a header.
While sorting I want to skip the fisrt rec and sort the remaining.
I am using the below code in sort card.

SORT FIELDS=(4,3,CH,A,1,3,CH,A),
SKIPREC=1

But the output record is removing 1st record which I am skiping.
Can anyone tel me how to start sorting the rec after 1st rec.
The output file should have the first rec. also

Thanks
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Dec 10, 2008 11:14 am    Post subject:
Reply with quote

Hello,

Which sort product are you using on your system? Which release?

One way to do what you want is to force an "A" at the end of the "header" and "B"s at the end of the other records. The sort then becomes this contrived field to keep the first record first followed by the positons you want to sort.

Is there something unique about the first record other than placement in the file?
Back to top
View user's profile Send private message
dp33770

New User


Joined: 04 Jul 2007
Posts: 92
Location: Hyderabad

PostPosted: Wed Dec 10, 2008 11:20 am    Post subject:
Reply with quote

We use SYNCSORT.
The first rec is just a header which need to come at first position.
I cant append 'A' and 'B' in the records...as the file is being FTPed after.
DO we hav something like Start AFter or STARTREC ....
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Dec 10, 2008 11:30 am    Post subject:
Reply with quote

Hello,

This would be a bit less than elegant, but you could copy the first record into a new work file1 (it will only have 1 record).

You would then sort all of the records #2 thru #n into a new work file2.

Lastly you could concatenate the single record file1 before the sorted many record file2 copying all the records to the final output file.

FTP the final output file.

If this was my requirement, i'd write the very little bit of cobol code needed.
Back to top
View user's profile Send private message
dp33770

New User


Joined: 04 Jul 2007
Posts: 92
Location: Hyderabad

PostPosted: Wed Dec 10, 2008 11:31 am    Post subject:
Reply with quote

Thank you....
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2180
Location: @my desk

PostPosted: Wed Dec 10, 2008 12:09 pm    Post subject:
Reply with quote

dp33770,

As suggested here earlier, you CAN add some indicators to the header record/detail records, do the sort and remove it while writing to output. Do you have anything which identifies a header record?

Please post a few sample records with relevant fields and input file attributes..
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts How to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us