View previous topic :: View next topic
|
Author |
Message |
richie_techin
New User
Joined: 21 Jan 2006 Posts: 16 Location: india
|
|
|
|
hi guys,
can u plz tell me how do delete a VSAM ESDS cluster thru COBOL? |
|
Back to top |
|
|
LeonL
New User
Joined: 20 Jan 2006 Posts: 5
|
|
|
|
I'm assuming you will use a batch job to execute your Cobol program and then you will have to allocate a (temporary) data set (RECFM=FB,LRECL=80).
Write DELETE statements from your Cobol program to this data set:
" DELETE 'name-of-data-set' CLUSTER PURGE"
There must be 2 spaces in front of the DELETE keyword!
In your next JCL step execute PGM=IDCAMS with the temporary file assigned to DDname SYSIN. |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
Hi Richie,
In the title of your thread you write:
Quote: |
how do u delete a ESDS record thru COBOL? |
In your msg you write:
Quote: |
can u plz tell me how do delete a VSAM ESDS cluster thru COBOL? |
Which is it, record or cluster? |
|
Back to top |
|
|
richie_techin
New User
Joined: 21 Jan 2006 Posts: 16 Location: india
|
|
|
|
hi,
i am sorry..i wanted to delete a record.if it does not delete,then what error code does it give? |
|
Back to top |
|
|
LeonL
New User
Joined: 20 Jan 2006 Posts: 5
|
|
|
|
Vishal,
It has been some time since I processed a VSAM ESDS in Cobol, so I had to look in the manual.
There it says that you can't delete a record from a VSAM ESDS.
So you'll have to create a new VSAM ESDS, which you can do by using IDCAMS:
//STEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DEFINE CLUSTER -
(NAME(your.new.esds) -
.
.
(use the same parameters you used for the original ESDS)
.
IF LASTCC = 0 THEN -
REPRO IDS(your.old.esds) -
ODS(your.new.esds) -
COUNT(xxxx)
/*
// IF STEP1.RC = 0 THEN
//STEP2 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//OUT DD DSN=your.new.esds,DISP=MOD
//SYSIN DD *
REPRO IDS(your.old.esds) -
OFILE(OUT) -
SKIP(yyyy)
/*
// ENDIF
In STEP1 you supply the number of records to copy up to (but not including!) the record you want to remove.
In STEP2 you supply the number of STEP1 +1 to skip the record you want to remove.
So if you want to remove record 537 then STEP1 should read COUNT(536) while STEP2 should read SKIP(537) |
|
Back to top |
|
|
sunish
New User
Joined: 23 May 2005 Posts: 19
|
|
|
|
hi
you cannot delete a esds record. pl correct me if iam wrong |
|
Back to top |
|
|
nuthan
Active User
Joined: 26 Sep 2005 Posts: 146 Location: Bangalore
|
|
|
|
Hi,
i think U cant delete an ESDS record but u can rewrite with another record of same Length. |
|
Back to top |
|
|
khamarutheen
Active Member
Joined: 23 Aug 2005 Posts: 677 Location: NJ
|
|
|
|
Hi ,
Sunish Says:
Quote: |
you cannot delete a esds record. pl correct me if iam wrong |
Yes u r right. ESDS records can only be rewrited and it cannot be deleted.... |
|
Back to top |
|
|
dneufarth
Active User
Joined: 27 Apr 2005 Posts: 419 Location: Inside the SPEW (Southwest Ohio, USA)
|
|
|
|
while there is no way to physically delete the record, you could rewrite it with a logical 'deleted' flag of your own design
or, you can do the old school way of reading the original file and only writing the records you want to a 'new' file -- in effect deleting the record(s) |
|
Back to top |
|
|
|