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
 

 

How to sort only part of the input file?

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

New User


Joined: 04 Dec 2009
Posts: 15
Location: Shanghai China

PostPosted: Fri Jan 07, 2011 6:44 am    Post subject: How to sort only part of the input file?
Reply with quote

Hello, Everyone:
There is one file with the first line which is the header and the last line which is the tailer. I want only the middle lines be sorted, but the first line and the last line should still be there in the output file. So I can not simply do it by include cond or omit cond. How can I do then?

Ps: The record type can be distinguished by the first 2 positions, for the header it is 01, 02 for the records I want to sort, 03 for the tailer.
Back to top
View user's profile Send private message

superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Fri Jan 07, 2011 7:09 am    Post subject: Reply to: How to sort only part of the input file?
Reply with quote

The DATASORT operator of DFSORT's ICETOOL is what you need to use.

Also, see:

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA50/7.6?DT=20100630155256
Back to top
View user's profile Send private message
Rock Xu

New User


Joined: 04 Dec 2009
Posts: 15
Location: Shanghai China

PostPosted: Fri Jan 07, 2011 9:02 am    Post subject:
Reply with quote

Hello, Superk:
My records is like this:
01header
02.........
02.........
02.........
03tailer

The record length is 180. And I tried this way:
INREC IFTHEN=(WHEN=INIT,OVERLAY=(181:C'1')),
IFTHEN=(WHEN=(1,2,CH,EQ,C'01'),OVERLAY=(181:C'0'))
SORT FIELDS=(23,4,CH,A;45,8,CH,A;54,6,CH,A)
INREC IFTHEN=(WHEN=(1,2,CH,EQ,C'03'),OVERLAY=(181:C'9'))
OUTREC FIELDS=(1,180)

The output like this:
01header
03tailer
02.........
02.........
02.........

As you see, althought header and tailer have been retained but I want to move the tailer to the last line.(Because it is the tailer.)
Back to top
View user's profile Send private message
singhju

New User


Joined: 01 Dec 2010
Posts: 25
Location: Gurgaon

PostPosted: Fri Jan 07, 2011 9:09 am    Post subject:
Reply with quote

Give a simple try to DATASORT as suggested by superk and it will work for you. Moreover it is more simpler than what you are trying.
Back to top
View user's profile Send private message
Rock Xu

New User


Joined: 04 Dec 2009
Posts: 15
Location: Shanghai China

PostPosted: Fri Jan 07, 2011 3:08 pm    Post subject:
Reply with quote

Yeah. It works. Thanks, superk and singhju.
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 SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Performing arithmetic on input field zh_lad DFSORT/ICETOOL 31 Tue Dec 06, 2016 8:04 pm
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 15 Thu Dec 01, 2016 8:28 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm


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