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

I/P & OUTPUT in jcl - want the records without duplicate


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
swetha9

New User


Joined: 10 Nov 2005
Posts: 3
Location: Bangalore

PostPosted: Sun Dec 24, 2006 12:19 pm
Reply with quote

Hi Fager & ALL,
Hope u all fine..
I'm requesting you all,please help me out.cos,I'm new to jcl as i'm from SAS.


I/P file
Health ID RD
123456789 77
023457890 77
876392028 09
562728727 08
267282822 04
252627278 75
526272728 87
222728289 08
635237288 77


Desired O/P file

123456789 77
876392028 09
222728289 08
267282822 04
252627278 75
526272728 87


I've three records which corressponds 77(RD) & it was sorted order before the writing into ouput.but I want the records without duplicates,so it will take the 1st sort record from the i/p file,which is a one of the duplicate record.
so,how to eliminate the duplicates from the file which i've three records.
I've one query,usually it will take 1st sort record or 2nd duplicate record or 3rd one.
like this I've some other records which having similar type of duplicates.
562728727 08
222728289 08
I've given
//SYSIN DD *
SORT FILEDS (12,2 EQ 'C RD)
SUM FIELDS=NONE
/*
//
I'm not able to find the sol & facing some error.

I'm requesting you all,please help me out.cos,I'm new to jcl as i'm from SAS.
Fager,I hope you'll give a better solution.
Thanks,
Swetha Reddy.
Bangalore.
India.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Sun Dec 24, 2006 7:51 pm
Reply with quote

Hi Swetha,
Quote:
Desired O/P file

123456789 77
876392028 09
222728289 08
267282822 04
252627278 75
526272728 87
First, isn't that 77 in column 11 and 12 rather than 12 and 13?
Second, to eliminate dups you will have to sort on those columns but your desired output is not in that order, is this order required?
Third, the first 77 record was kept but the second 08 record was kept, how are you decieding on that?
Sort can get rid of the dups and can keep the original order but without understanding fully your needs, it is hard.

Bill
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: Sun Dec 24, 2006 9:55 pm
Reply with quote

Swetha,

Who is Fager?

Your post is a bit unlcear as to what you're trying to do. The output you show:

Code:

123456789  77
876392028  09
222728289  08
267282822  04
252627278  75
526272728  87


seems to take random records for the dups (e.g. the first record for the 77 dups, but the second record for the 08 dups).

I'm guessing that what you really want is to keep the first record with each value, but have the output in the original order of the input. If that's the case, then for your example, the output would be:

Code:

123456789  77 
876392028  09 
562728727  08 
267282822  04 
252627278  75 
526272728  87 


and you can use the following DFSORT/ICETOOL job to get that output. I assumed that your input file has RECFM=FB and LRECL=80, but the job can be changed appropriately for other attributes. Note the use of OPTION EQUALS which tells DFSORT to keep the first record which each value.

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN DD *
123456789  77
023457890  77
876392028  09
562728727  08
267282822  04
252627278  75
526272728  87
222728289  08
635237288  77
/*
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT DD SYSOUT=*
//TOOLIN   DD    *
SORT FROM(IN) TO(T1) USING(CTL1)
SORT FROM(T1) TO(OUT) USING(CTL2)
/*
//CTL1CNTL DD *
  INREC OVERLAY=(81:SEQNUM,8,ZD)
  SORT FIELDS=(12,2,CH,A)
  OPTION EQUALS
  SUM FIELDS=NONE
/*
//CTL2CNTL DD *
  SORT FIELDS=(81,8,ZD,A)
  OUTREC BUILD=(1,80)
/*



If that's not what you want, then you need to explain more clearly your "rules" for getting from input to output.
Back to top
View user's profile Send private message
swetha9

New User


Joined: 10 Nov 2005
Posts: 3
Location: Bangalore

PostPosted: Thu Dec 28, 2006 7:00 pm
Reply with quote

Hi,

Frank,

I mistaken typed wrongly.I supposed to write "frank",unfortunate i did mistake.I'm very sorry.

coming to my requirement,I will update today,what i need exact & as i'm waiting from customer .as they given some inputs,so we doing some analysis.
I'm very sorry,i've given wrong o/p file.I will send my exact requirement.
Hopefully,I can send the customer requirement this coming next week.as they are on vaccation till jan 2.in meantime,i will send my estimation requiremnt.
Thank you frank for your support.
and Bill ..thanks for your inputs.
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 Duplicate transid's declared using CEDA CICS 3
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
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 Joinkeys - 5 output files DFSORT/ICETOOL 7
Search our Forums:

Back to Top