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

Sort all the Data records based on a field from 10-20 in Asc


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sreekusr
Warnings : 1

New User


Joined: 28 Aug 2006
Posts: 54
Location: Madrid

PostPosted: Thu Feb 12, 2009 7:16 am
Reply with quote

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
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Thu Feb 12, 2009 7:48 am
Reply with quote

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
View user's profile Send private message
sreekusr
Warnings : 1

New User


Joined: 28 Aug 2006
Posts: 54
Location: Madrid

PostPosted: Thu Feb 12, 2009 8:17 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Thu Feb 12, 2009 8:42 am
Reply with quote

Hello,

Please explain how this might be a requirement. . .
Back to top
View user's profile Send private message
sreekusr
Warnings : 1

New User


Joined: 28 Aug 2006
Posts: 54
Location: Madrid

PostPosted: Thu Feb 12, 2009 11:30 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Thu Feb 12, 2009 11:42 am
Reply with quote

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
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Thu Feb 12, 2009 3:04 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Thu Feb 12, 2009 8:58 pm
Reply with quote

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 icon_smile.gif

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
View user's profile Send private message
sreekusr
Warnings : 1

New User


Joined: 28 Aug 2006
Posts: 54
Location: Madrid

PostPosted: Fri Feb 13, 2009 11:41 am
Reply with quote

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
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts How to save SYSLOG as text data via P... All Other Mainframe Topics 2
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Store the data for fixed length COBOL Programming 1
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
Search our Forums:

Back to Top