IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Sort After 1 rec


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
dp33770

New User


Joined: 04 Jul 2007
Posts: 91
Location: Hyderabad

PostPosted: Wed Dec 10, 2008 11:07 am
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

Moderator Emeritus


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

PostPosted: Wed Dec 10, 2008 11:14 am
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: 91
Location: Hyderabad

PostPosted: Wed Dec 10, 2008 11:20 am
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

Moderator Emeritus


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

PostPosted: Wed Dec 10, 2008 11:30 am
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: 91
Location: Hyderabad

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

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

Moderator


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

PostPosted: Wed Dec 10, 2008 12:09 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
Search our Forums:

Back to Top