IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Selection of records using sort


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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: 1208
Location: Bangalore,India

PostPosted: Thu Dec 07, 2006 5:56 pm
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 Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Dec 07, 2006 10:50 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts JCL sort card - get first day and las... JCL & VSAM 9
Search our Forums:

Back to Top