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
 

 

Selection of records using sort

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

New User


Joined: 08 Aug 2005
Posts: 9

PostPosted: Thu Dec 07, 2006 5:16 pm    Post subject: Selection of records using sort
Reply with quote

Hi,

I am having a file of the following order

Input file

990100030,7113058019,10.89,2.92,13.39,1,1,1,1,1,1
990100030,7113058020,0,0,0,0,0,0,0,0,0
990100034,8173098018,10.89,2.92,13.39,1,1,1,1,1,1
990100034,8173098019,0,0,0,0,0,0,0,0,0
990100038,8173099018,0,0,0,0,0,0,0,0,0
990100038,8173099018,10.89,2.92,13.39,1,1,1,1,1,1
990100040,8173099058,0,0,0,0,0,0,0,0,0

Output file
990100030,7113058019,10.89,2.92,13.39,1,1,1,1,1,1
990100034,8173098018,10.89,2.92,13.39,1,1,1,1,1,1
990100038,8173099018,10.89,2.92,13.39,1,1,1,1,1,1
990100040,8173099058,0,0,0,0,0,0,0,0,0


The requirement is like if the if the number in pos 1-9 is repeating i have to select the record which has values from pos 21-48 Ie, if a file has 2 or more records with repeating values in the field from 1-9 i need to select only one record which has non zero values in position 21-48

Is it possible to do using a sort?
Back to top
View user's profile Send private message

guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Thu Dec 07, 2006 5:56 pm    Post subject:
Reply with quote

Hi there,

Code:
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=...  input file
//OUT DD DSN=...  output file
//TOOLIN DD *
SELECT FROM(IN) TO(OUT) ON(1,9,CH) ALLDUPS USING(CTL1)
/*
//CTL1CNTL DD *
  OUTFIL FNAMES=OUT,OMIT=(21,28,ZD,EQ,0)
/*


It should work i Have not tried it as my shop does not contain ICETOOl
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 07, 2006 10:50 pm    Post subject:
Reply with quote

prasanth_bs,

Ekta's job won't do what you asked for (I don't think Ekta understood the requirement).

But this DFSORT/ICETOOL job will do what you asked for. I assumed your input file has RECFM=FB and LRECL=80, but the job can be changed appropriately for other attributes.

Code:

//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=...  input file (FB/80)
//OUT DD DSN=...  output file (FB/80)
//TOOLIN DD *
SELECT FROM(IN) TO(OUT) ON(1,9,CH) FIRST USING(CTL1)
/*
//CTL1CNTL DD *
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:C'A')),
    IFTHEN=(WHEN=(22,17,CH,EQ,C'0,0,0,0,0,0,0,0,0'),
      OVERLAY=(81:C'B'))
  SORT FIELDS=(1,9,CH,A,81,1,CH,A)
  OUTFIL FNAMES=OUT,BUILD=(1,80)
/*
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 to unpack a feild shr_amar DFSORT/ICETOOL 7 Fri Jul 07, 2017 4:32 am
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts Optimize sort inrec parse vishwakotin DFSORT/ICETOOL 6 Mon Jun 26, 2017 11:15 pm
No new posts Reduce CPU Times for Join Sort santoshn SYNCSORT 12 Sat Jun 10, 2017 1:40 pm
No new posts Db2 load job abending in SORT mistah kurtz DB2 4 Mon Jun 05, 2017 3:58 pm


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