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: 1190
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 numeric fields with trailing spaces sancraig16 SYNCSORT 7 Tue Apr 03, 2018 1:21 am
No new posts Extract the records with a PD field's... sudhakar84 DFSORT/ICETOOL 11 Mon Apr 02, 2018 7:26 pm
No new posts Find & Replace string in CA-SORT mrgnndhmk CA Products 1 Fri Mar 30, 2018 12:58 am
No new posts Merge 2 records sancraig16 SYNCSORT 19 Tue Mar 27, 2018 8:17 pm
No new posts SORT 3 files,extract specific fields ... Kiransr DFSORT/ICETOOL 13 Fri Mar 23, 2018 10:54 am

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