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
 
Want only selected records in output.

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

New User


Joined: 10 Nov 2006
Posts: 49
Location: Canada

PostPosted: Wed Mar 12, 2008 5:51 pm    Post subject: Want only selected records in output.
Reply with quote

Hi,
I have an input file:
Input:

Code:

A        B C    D
----------------------
C1111 A P11 080711
C1111 A P11 080711
C1111 A P11 070711
C1111 A P11 070711
C1111 A P22 080511
C1111 A P22 080511
C1111 B P11 080711
C1111 B P11 080711
C1111 B P11 060711
C1111 B P11 060711
C1111 B P22 060711
C1111 B P22 060711


Output should like:
Code:

A        B C    D
----------------------
C1111 A P11 080711
C1111 A P11 080711
C1111 A P22 080511
C1111 A P22 080511
C1111 B P11 080711
C1111 B P11 080711
C1111 B P22 060711
C1111 B P22 060711


The requirement is for all records having Col A, B and C matching; check Col D. , and out records having greatest value of Col D.

Now if Col A and Col B are matching and Col C is different no need to check Col D.

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

Skolusu

Senior Member


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

PostPosted: Wed Mar 12, 2008 9:50 pm    Post subject:
Reply with quote

Code:

//STEP0100 EXEC PGM=ICETOOL                                         
//TOOLMSG  DD SYSOUT=*                                             
//DFSMSG   DD SYSOUT=*                                             
//IN       DD * 
----+----1----+----2----+----3                                                   
C1111 A P11 080711                                                 
C1111 A P11 080711                                                 
C1111 A P11 070711                                                 
C1111 A P11 070711                                                 
C1111 A P22 080511                                                 
C1111 A P22 080511                                                 
C1111 B P11 080711                                                 
C1111 B P11 080711                                                 
C1111 B P11 060711                                                 
C1111 B P11 060711                                                 
C1111 B P22 060711                                                 
C1111 B P22 060711                                                 
//T1       DD DSN=&T1,DISP=(,PASS),SPACE=(CYL,(1,1),RLSE)           
//OUT      DD SYSOUT=*                                             
//TOOLIN   DD *                                                     
  SORT   FROM(IN) USING(CTL1)                                       
  SPLICE FROM(T1) TO(OUT) ON(1,12,CH) WITH(1,19) WITHALL USING(CTL2)
//CTL1CNTL DD *                                                     
  SORT FIELDS=(01,11,CH,A)                                         
  OUTREC OVERLAY=(20:6X)                                           
  OUTFIL FNAMES=T1,REMOVECC,                                       
  SECTIONS=(01,11,                                                 
  TRAILER3=(01,12,20:MAX=(13,6,ZD,M11,LENGTH=6)))                   
//CTL2CNTL DD *                                                     
  SORT FIELDS=(01,12,CH,A,                                         
               20,06,CH,D)                                         
  OUTFIL FNAMES=OUT,BUILD=(01,19),                                 
  INCLUDE=(13,06,CH,EQ,20,06,CH)                                   
/*


Hope this helps...
Back to top
View user's profile Send private message
kaushik8205

New User


Joined: 10 Nov 2006
Posts: 49
Location: Canada

PostPosted: Thu Mar 13, 2008 7:04 pm    Post subject: Hi
Reply with quote

Thanks for the response.
There is a bit of modification in the requirement.
Input file:
X C1111 A P11 080711 Y
Y C1111 A P11 080711 X
X C1111 A P11 070711 X
Y C1111 A P11 070711 Y
Z C1111 A P22 080511 Z
S C1111 A P22 080511 S
AZ C1111 B P11 080711 AZ
ZA C1111 B P11 080711 ZA
AZ C1111 B P11 060711 AZ
ZA C1111 B P11 060711 ZA
A C1111 B P22 060711 A
B C1111 B P22 060711 B

Output file should like:
X C1111 A P11 080711 Y
Y C1111 A P11 080711 X
Z C1111 A P22 080511 Z
S C1111 A P22 080511 S
AZ C1111 B P11 080711 AZ
ZA C1111 B P11 080711 ZA
A C1111 B P22 060711 A
B C1111 B P22 060711 B

i.e if Col A, B and C matching; check Col D. , and out records having greatest value of Col D.
So all other values of the record being selected should be from the records having greatest value of Col D.

With your solution I am getting output as:
Y C1111 A P11 080711 Y
Y C1111 A P11 080711 Y
S C1111 A P22 080511 S
S C1111 A P22 080511 S
ZA C1111 B P11 080711 ZA
ZA C1111 B P11 080711 ZA
B C1111 B P22 060711 B
B C1111 B P22 060711 B

Please let me know if you have a solution to above requirement.
Thanks
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 Skip records depends on count lakshmiibmmainframes DFSORT/ICETOOL 5 Sun Dec 24, 2017 9:51 pm
No new posts Compare two PS files using ICE TOOL f... SENTHIL MURUGAAN DFSORT/ICETOOL 5 Sun Dec 24, 2017 1:26 pm
No new posts Inefficient BUILD - VB records paddin... Daniel Prosser SYNCSORT 9 Thu Dec 14, 2017 3:52 pm
No new posts ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm
No new posts Merging 2 records at multiple rows wi... Bijesh DFSORT/ICETOOL 2 Wed Dec 06, 2017 1:50 am

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