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: 50
Location: London

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: 50
Location: London

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: 50
Location: London

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: 2285
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: 50
Location: London

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 Split file based on comparsion to 2 f... Div Grad DFSORT/ICETOOL 3 Thu Jul 27, 2017 9:16 pm
No new posts Paasing symbolic parameter to instrea... Robert Sample JCL & VSAM 2 Thu Jul 27, 2017 1:22 pm
No new posts Passing data from REXX to C programme... chong.zhou CLIST & REXX 3 Wed Jul 26, 2017 9:11 pm
No new posts copying data without knowing location Arun Raj DFSORT/ICETOOL 12 Thu Jul 20, 2017 1:03 pm
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm


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