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 all the Data records based on a field from 10-20 in Asc

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
sreekusr
Warnings : 1

New User


Joined: 28 Aug 2006
Posts: 45
Location: Mumbai

PostPosted: Thu Feb 12, 2009 7:16 am    Post subject: Sort all the Data records based on a field from 10-20 in Asc
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: 1703
Location: Australia

PostPosted: Thu Feb 12, 2009 7:48 am    Post subject:
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: 45
Location: Mumbai

PostPosted: Thu Feb 12, 2009 8:17 am    Post subject: Reply to: Sorting Query
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

Site Director


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

PostPosted: Thu Feb 12, 2009 8:42 am    Post subject:
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: 45
Location: Mumbai

PostPosted: Thu Feb 12, 2009 11:30 am    Post subject: Reply to: Sort all the Data records based on a field from 10
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

Site Director


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

PostPosted: Thu Feb 12, 2009 11:42 am    Post subject:
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: 2180
Location: @my desk

PostPosted: Thu Feb 12, 2009 3:04 pm    Post subject:
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

Site Director


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

PostPosted: Thu Feb 12, 2009 8:58 pm    Post subject:
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: 45
Location: Mumbai

PostPosted: Fri Feb 13, 2009 11:41 am    Post subject: Reply to: Sort all the Data records based on a field from 10
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Storing huge volume of data, compare ... Pradeep K M All Other Mainframe Topics 3 Mon Jan 16, 2017 5:08 pm
No new posts how to recover an uncataloged VSAM da... archanamuthukrishnan All Other Mainframe Topics 3 Wed Jan 11, 2017 6:18 pm
No new posts INVALID FIELD OR CONSTANT IN SORTOF ?? Ron Klop DFSORT/ICETOOL 8 Wed Jan 11, 2017 3:44 pm
No new posts HALDB data refresh/copy from producti... vineetanand2007 IMS DB/DC 0 Mon Jan 02, 2017 11:16 am
No new posts JES2 JEC: Use UNIX Pipes to Pass Data... Virendra Shambharkar JCL & VSAM 21 Tue Dec 20, 2016 6:55 pm


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