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
 

 

Help on Sorting

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

New User


Joined: 13 Feb 2013
Posts: 2
Location: INDIA

PostPosted: Wed Feb 13, 2013 4:31 pm    Post subject: Help on Sorting
Reply with quote

Hi,

Need Help on below.

I have input file with data below. f1,f2,f3,q1,q2 are the field names that mentioned here for understanding purpose, below them actual data that each field contains.
q1 contains postive value or zeros
q2 contains negative value or zeros

Have to sort the input file based on f1,f2,f3 and the output file we should get a unique record which has a non zero value.
Could you please let us know how to do this.
I have given the input and output file conents for better understanding.

Input file:

Code:
               f1   f2  f3   q1     q2 
              abc def ghi  0      0
              abc def ghi  20     0
              abc def ghi  20     0
              abc def ghi  20     0
              pqr stu vwx  0      0
              pqr stu vwx  0     -90
              pqr stu vwx  0     -90




Output file should contains

Code:
            abc def ghi  20     0
            pqr stu vwx  0     -90
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7307

PostPosted: Wed Feb 13, 2013 4:43 pm    Post subject: Reply to: Help on Sorting
Reply with quote

How about OMIT where q1 and q2 equal zero.

You could then do a simple SUM with FIELDS=NONE (with you data shown).
Back to top
View user's profile Send private message
kenar.t

New User


Joined: 13 Feb 2013
Posts: 2
Location: INDIA

PostPosted: Wed Feb 13, 2013 5:14 pm    Post subject: Reply to: Help on Sorting
Reply with quote

Have forgot to include one scenario, i have one more record in the the input file as below, this should also appear in my output file

Code:
ijk lmn opq 0 0


My output file looks like this.

Code:
abc cde fgh 20 0
ijk  lmn opq 0 0
pqr stu vwx 0 -90
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1534
Location: Andromeda Galaxy

PostPosted: Wed Feb 13, 2013 5:22 pm    Post subject:
Reply with quote

Omit all the records with two 0 except for this ijk lmn opq 0 0

Which is OMIT q1 and q2 equal 0 and f1 not equal to ijk , f2 is not equal to lmn and f3 not equal to opq

and do SUM FIELDS=NONE
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7307

PostPosted: Wed Feb 13, 2013 5:42 pm    Post subject: Reply to: Help on Sorting
Reply with quote

Are all your non-zero values always guaranteed to be the same?

Have a look at ICETOOL's SELECT operator. Sort on your three key fields AND the s new key field which you make by adding together the two numeric values, and sort on that descending.

Use FIRST on ICETOOL.
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 Sorting group data rajella DFSORT/ICETOOL 4 Sun Jan 22, 2017 11:32 pm
No new posts Efficient sorting chandracdac DFSORT/ICETOOL 5 Sat Oct 22, 2016 3:23 am
No new posts Stripping and Sorting of VB file G SRINIVASA RAO SYNCSORT 5 Wed Sep 14, 2016 1:34 pm
No new posts DFSORT sorting only specific records akodakka DFSORT/ICETOOL 4 Thu Aug 04, 2016 11:24 am
No new posts VB file sorting V S Amarendra Reddy DFSORT/ICETOOL 2 Fri Feb 26, 2016 8:29 pm


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