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
 
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 records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts JOINKEYS Paired and Unpaired Sort MFwhiz DFSORT/ICETOOL 4 Fri Sep 29, 2017 1:48 am
No new posts Difference in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 5 Fri Sep 22, 2017 4:56 pm
No new posts OC4 in SORT Mohan Kothakota DFSORT/ICETOOL 2 Tue Sep 12, 2017 6:30 pm

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