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 between the headers and footers

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
seerajen
Currently Banned

New User


Joined: 05 Aug 2008
Posts: 10
Location: bangalore

PostPosted: Wed Dec 10, 2008 4:54 pm    Post subject: Sort between the headers and footers
Reply with quote

An input file with some set of records the format of the input is as shown below:

I/p file format:

Header1

Record1
Record2
Record3
.........
........
.........
RecordN

Footer1

Header2

Record1
Record2
Record3
.........
........
.........
RecordN

Footer2

Header3

Record1
Record2
Record3
.........
........
.........
RecordN

Footer3


My need is the Header and Foorter should not change their places but the records between every header and footer should be sorted in the output file.

Output file format:

Header1

Sorted records

Footer1

Header2

Sorted records

Footer2

Header3

Sorted records

Footer3

Seenu
Back to top
View user's profile Send private message

mainframeracf

New User


Joined: 27 Nov 2008
Posts: 5
Location: bangalore

PostPosted: Wed Dec 10, 2008 5:08 pm    Post subject: Reply to: Can any help to SORT, i have a special requirement
Reply with quote

hi,

In ur input file there is only 3 headers & 3 footers or more number of headers & footers. If it is 3 only then u can use not equal opertor and sort the other records.
Back to top
View user's profile Send private message
seerajen
Currently Banned

New User


Joined: 05 Aug 2008
Posts: 10
Location: bangalore

PostPosted: Wed Dec 10, 2008 5:48 pm    Post subject:
Reply with quote

hi,
thanks for ur quick reply..
the thing is i have so many 'header - records - footer' sets.. the header and foooter should be same but the set of the records present should be sorted...... in between every header and footer.

thanks,
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1002
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Wed Dec 10, 2008 6:23 pm    Post subject:
Reply with quote

Have you looked at http://www-304.ibm.com/systems/support/resources/sorttrck.pdf ? There's a section dealing with sorting between header(s) and trailer(s).

Garry.
Back to top
View user's profile Send private message
seerajen
Currently Banned

New User


Joined: 05 Aug 2008
Posts: 10
Location: bangalore

PostPosted: Wed Dec 10, 2008 6:37 pm    Post subject:
Reply with quote

hi,.
but it doesn't work,,,,,, it is mentioning only one set of 'header - record - footer'. but in my ip file after one footer is ended another header will begin which should not be touched.
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1002
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Wed Dec 10, 2008 8:16 pm    Post subject:
Reply with quote

Pages 14-18 give examples of sorting GROUPs such as you describe.

Garry.
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Wed Dec 10, 2008 10:45 pm    Post subject: Reply to: Sort between the headers and footers
Reply with quote

seerajen,

You can very easily split using the new WHEN=GROUP function of DFSORT available with z/OS DFSORT V1R5 PTF UK90013 (July, 2008) like this:

Code:

//STEP0100 EXEC PGM=ICEMAN                               
//SYSOUT   DD SYSOUT=*                                   
//SORTIN   DD *                                           
HEADER-01                                                 
60                                                       
20                                                       
30                                                       
FOOTER-01                                                 
HEADER-02                                                 
10                                                       
80                                                       
10                                                       
FOOTER-02                                                 
HEADER-03                                                 
20                                                       
00                                                       
05                                                       
FOOTER-03                                                 
//SORTOUT  DD SYSOUT=*                                   
//SYSIN    DD *                                           
  OPTION EQUALS                                           
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,6,CH,EQ,C'HEADER'),   
  PUSH=(81:ID=2,SEQ=8)),                                 
  IFTHEN=(WHEN=(83,8,ZD,EQ,1),OVERLAY=(83:8C'0')),       
  IFTHEN=(WHEN=(1,6,CH,EQ,C'FOOTER'),OVERLAY=(83:8C'2')),
  IFTHEN=(WHEN=NONE,OVERLAY=(83:8C'1'))                   
  SORT FIELDS=(81,10,CH,A,1,2,CH,A)                       
  OUTREC BUILD=(1,80)                                     
/*


The output from this job is

Code:

HEADER-01     
20             
30             
60             
FOOTER-01     
HEADER-02     
10             
10             
80             
FOOTER-02     
HEADER-03     
00             
05             
20             
FOOTER-03     


If you don't have the July, 2008 PTF installed, ask your System Programmer to install it (it's free).

For complete details on the new WHEN=GROUP and the other new functions available with PTF UK90013, see:

www.ibm.com/systems/support/storage/software/sort/mvs/ugpf/
Back to top
View user's profile Send private message
seerajen
Currently Banned

New User


Joined: 05 Aug 2008
Posts: 10
Location: bangalore

PostPosted: Thu Dec 11, 2008 9:30 am    Post subject:
Reply with quote

Thanks for you reply....... but the thing is am using "PGM=SORT", and also explain what does those control cards mean so that i change according to my requirement........
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 Dec 11, 2008 9:50 am    Post subject:
Reply with quote

Hello,

Quote:
but the thing is am using "PGM=SORT"
PGM=SORT or PGM=ICEMAN will invoke the sort product used at your site.

The link in the reply above your last reply is where to find the documentation of how "the new WHEN=GROUP and the other new functions" operate.

Quote:
If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

www.ibm.com/servers/storage/support/software/sort/mvs/srtmpub.html
Back to top
View user's profile Send private message
seerajen
Currently Banned

New User


Joined: 05 Aug 2008
Posts: 10
Location: bangalore

PostPosted: Thu Dec 11, 2008 11:06 am    Post subject:
Reply with quote

my PGM=SORT is invoking ICEMAN that am aware,,, but the thing is i doesn't understand the control cards mentioned in the above example can any one explain them.............

PUSH=(81:ID=2,SEQ=8)),
IFTHEN=(WHEN=(83,8,ZD,EQ,1),OVERLAY=(83:8C'0')),
IFTHEN=(WHEN=(1,6,CH,EQ,C'FOOTER'),OVERLAY=(83:8C'2')),
IFTHEN=(WHEN=NONE,OVERLAY=(83:8C'1'))
SORT FIELDS=(81,10,CH,A,1,2,CH,A)
OUTREC BUILD=(1,80)

thanks
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1002
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Thu Dec 11, 2008 3:34 pm    Post subject:
Reply with quote

These control statements are fully explained in the DFSORT documentation. The Smart Tricks manual at the link I provided earlier gives you all the explanation you need.

Garry.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Thu Dec 11, 2008 9:59 pm    Post subject:
Reply with quote

Quote:
but the thing is i doesn't understand the control cards mentioned in the above example can any one explain them...........


Kolusu told you where to find the documentation that explains DFSORT's new WHEN=GROUP function in his first post:

Quote:
For complete details on the new WHEN=GROUP and the other new functions available with PTF UK90013, see:

www.ibm.com/systems/support/storage/software/sort/mvs/ugpf/


Did you look there?
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 SORT BUT RETAIN HIGHEST VALUE ON NON-... leondan22 DFSORT/ICETOOL 2 Thu Dec 14, 2017 8:13 pm
No new posts Extract record for change in combinat... Trinadh DFSORT/ICETOOL 6 Thu Nov 23, 2017 3:32 pm
No new posts JOINKEYS Paired and Unpaired Sort on ... MFwhiz DFSORT/ICETOOL 7 Tue Nov 07, 2017 2:46 am
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts JOINKEYS Paired and Unpaired Sort MFwhiz DFSORT/ICETOOL 4 Fri Sep 29, 2017 1:48 am

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