View previous topic :: View next topic
|
Author |
Message |
ousep143
New User
Joined: 06 Oct 2007 Posts: 32 Location: India
|
|
|
|
Hi,
How to delete a duplicate row in a flat file?Is it possible?
Thanks & Regards
[/b] |
|
Back to top |
|
|
acevedo
Active User
Joined: 11 May 2005 Posts: 344 Location: Spain
|
|
|
|
you should create a new file with those records omitted. |
|
Back to top |
|
|
raak
Active User
Joined: 23 May 2006 Posts: 166 Location: chennai
|
|
|
|
If u checked the forums, u might have found out that u can use a simple sort card to achieve this...
Quote: |
you should create a new file with those records omitted. |
but what does this mean??
|
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
It means keep the original input and create a new output, do not over write the original input file. |
|
Back to top |
|
|
ousep143
New User
Joined: 06 Oct 2007 Posts: 32 Location: India
|
|
|
|
Hi raak,
I want to know,how to delete duplicate record in a flat file or how to compare two records?
Regards
|
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
Acevedo' s reply simply meant that for flat (wrong term anyway) aka PS files
it is not possible to delete/insert records in place
do not confuse things when in the Ispf environment,... when editing a PS file
ISPF will just bring all the records in memory and afterwards ( at save time )
it will open the dataset in output and write out all the records |
|
Back to top |
|
|
ousep143
New User
Joined: 06 Oct 2007 Posts: 32 Location: India
|
|
|
|
hi enrico,
Is it possible to findout duplicate rows in a PS file.
Regards
|
|
Back to top |
|
|
acevedo
Active User
Joined: 11 May 2005 Posts: 344 Location: Spain
|
|
|
|
expat and enricho assumptions are correct, of course.
ousep143
1-read the posts about delete a PS file.
2-compare... that's another question.
this post is in the Cobol forum...maybe you shoud try a search in the DFSORT/ICETOOL forum.
;) |
|
Back to top |
|
|
raak
Active User
Joined: 23 May 2006 Posts: 166 Location: chennai
|
|
|
|
Just curious...
the original question was
Quote: |
How to delete a duplicate row in a flat file?Is it possible? |
If I give a SUM FIELDS=NONE on this file and give the same file as output,
the duplicates should get eliminated.
Why should I require a new file for that??
Quote: |
do not over write the original input file |
why is this so?? Is it because in case any problem happens, there is a chance of the input records getting corrupted?? |
|
Back to top |
|
|
acevedo
Active User
Joined: 11 May 2005 Posts: 344 Location: Spain
|
|
|
|
IMNHO... we should know if this has to be done in Cobol or not.
IBMMAINFRAMES.com Support Forums -> Mainframe COBOL |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
Quote: |
Is it because in case any problem happens, there is a chance of the input records getting corrupted?? |
exactly that, when auditing operating standards and procedures, You cannot imagine
how many shops I have found using this WRONG/FOOLISH approach,
there is no saving in that,
and in one case after having been forced to carry on an in depth analysis
they found the duplicate records were the consequence of
a wrong design ( missing data checking ) and faulty programming
and they were even complaining about 12 hours rerun because of that |
|
Back to top |
|
|
ousep143
New User
Joined: 06 Oct 2007 Posts: 32 Location: India
|
|
|
|
Hi everybody,
Thanks for information.
Regards
|
|
Back to top |
|
|
mnnarayankar
New User
Joined: 21 Jan 2008 Posts: 23 Location: bangalore
|
|
|
|
nice questions.
One answer is this 1st load u r PS file into KSDS vsam dataset. using COBOL pgm or using REPRO command. VSAM KSDS allow to write only unique records with help of key. Once all unique data u get then unload VSAM file into PS file. |
|
Back to top |
|
|
mnnarayankar
New User
Joined: 21 Jan 2008 Posts: 23 Location: bangalore
|
|
|
|
use SORT utilities to elinminates the duplicate within a file
Syntax : Sort fields = (starting pos,length,type,asc/desc),EQUALS
Sum fields = none.
use INDD, OUTDD, and SORTWORK
starting position : anything but integer value.
length : Length mean total no of character from 1st character.
type means : ZD,PD,BI,CH
if EQUALS is coded then records to be written is the first record else it can be anything.. |
|
Back to top |
|
|
|