View previous topic :: View next topic
|
Author |
Message |
sreekusr Warnings : 1 New User
Joined: 28 Aug 2006 Posts: 54 Location: Madrid
|
|
|
|
Hello all,
Following are my requirements.
File layout
Header Record (identified by 00 in the first 2 places)
Data Record (identified by 04 in the First 2 places)- 80 Length
Footer Record (identified by 99 in the First 2 places)
Requirement:
I want to sort all the Data records based on a field from 10-20 in Ascending order and want to retain the Header and footer as it is.
i.e.
Header Record
Data Record (Sorted on a field from 10 to 20 in Ascending order)
Footer record.
Can anyone suggest a sort card to do the above operation.
Thanks
Sree |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
there are many examples in the forum, here is one of them
Code: |
//STEP0100 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD * input file
//OUT DD SYSOUT=*
//TOOLIN DD *
DATASORT FROM(IN) TO(OUT) HEADER TRAILER USING(CTL1)
//CTL1CNTL DD *
SORT FIELDS=(10,11,CH,A)
/*
|
Gerry |
|
Back to top |
|
|
sreekusr Warnings : 1 New User
Joined: 28 Aug 2006 Posts: 54 Location: Madrid
|
|
|
|
Hi,
Thanks a lot for the reply.
But can you please suggest me a way so that i could use only one control card for the whole sorting activity.
Thanks,
Sree |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Please explain how this might be a requirement. . . |
|
Back to top |
|
|
sreekusr Warnings : 1 New User
Joined: 28 Aug 2006 Posts: 54 Location: Madrid
|
|
|
|
Hello,
The requirement is to Sort input File (only data records) and write to an output file. And output file should contain the same layout as that of the input file. i.e. Header and Footer(from input file) should also be there along with the sorted data record.
And as per our coding standards we are supposed to use only one Control card per step in a JCL(Multiple steps not allowed). So i just want to know whether we can do these activity in a single step using a single Control card.
Thanks,
Sree |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
So i just want to know whether we can do these activity in a single step using a single Control card. |
I've not seen a way, someone else may have. . .
Suggest it is time to consider a standards revision. . .
If the rather elegant suggestion posted is not permissable, you could always write a new program and there would be no control statements. . . |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
sreekusr wrote: |
Header Record (identified by 00 in the first 2 places)
Data Record (identified by 04 in the First 2 places)- 80 Length
Footer Record (identified by 99 in the First 2 places)
Requirement:
I want to sort all the Data records based on a field from 10-20 in Ascending order and want to retain the Header and footer as it is
|
Wont this be enough? Or is it something I am missing here?
Code: |
//STEP001 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=input file
//SORTOUT DD DSN=output file
//SYSIN DD *
SORT FIELDS=(1,2,CH,A,10,11,CH,A)
/* |
|
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hi Arun,
Quote: |
Wont this be enough? Or is it something I am missing here? |
For this sort, i believe it will do just nicely
My hope was to get consideration that the outdated standard be revised. . .
For example if some other file had AA and ZZ as the header/trailer and a numeric record-type, this single statement would not work. . . |
|
Back to top |
|
|
sreekusr Warnings : 1 New User
Joined: 28 Aug 2006 Posts: 54 Location: Madrid
|
|
|
|
Hi All,
Thanks a lot for the reply.
The sortcard mentioned by Arun can be used for the scenario i mentioned in first :D .
Thanks,
Sree |
|
Back to top |
|
|
|