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 Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm


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