Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 54
Location: Madrid

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: 54
Location: Madrid

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: 54
Location: Madrid

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: 54
Location: Madrid

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 Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts opening a dataset after reading it fr... arunsoods DFSORT/ICETOOL 5 Wed Oct 04, 2017 3:54 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us