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
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: I/P & OUTPUT in jcl - want the records without duplicate
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: 3158
Location: Tucson AZ

PostPosted: Sun Dec 24, 2006 7:51 pm    Post subject:
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 Moderator


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

PostPosted: Sun Dec 24, 2006 9:55 pm    Post subject:
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    Post subject: SAS I/P & OUTPUT in jcl(duplicates)
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    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 Incorrect output when trying to add n... monica1 PL/I & Assembler 10 Fri Jan 13, 2017 5:02 pm
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 Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm
No new posts Syncsort - Hard coded Value in output PORYES SYNCSORT 1 Thu Nov 03, 2016 9:23 am


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