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
 

 

how do u delete a ESDS record thru COBOL?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
richie_techin

New User


Joined: 21 Jan 2006
Posts: 16
Location: india

PostPosted: Sat Jan 21, 2006 10:27 pm    Post subject: how do u delete a ESDS record thru COBOL?
Reply with quote

hi guys,

can u plz tell me how do delete a VSAM ESDS cluster thru COBOL?
Back to top
View user's profile Send private message

LeonL

New User


Joined: 20 Jan 2006
Posts: 5

PostPosted: Sun Jan 22, 2006 6:21 pm    Post subject:
Reply with quote

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
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sun Jan 22, 2006 8:13 pm    Post subject:
Reply with quote

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
View user's profile Send private message
richie_techin

New User


Joined: 21 Jan 2006
Posts: 16
Location: india

PostPosted: Mon Feb 06, 2006 12:28 pm    Post subject: esds
Reply with quote

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
View user's profile Send private message
LeonL

New User


Joined: 20 Jan 2006
Posts: 5

PostPosted: Mon Feb 06, 2006 1:40 pm    Post subject:
Reply with quote

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
View user's profile Send private message
sunish

New User


Joined: 23 May 2005
Posts: 19

PostPosted: Mon Feb 06, 2006 3:14 pm    Post subject: Re: how do u delete a ESDS record thru COBOL?
Reply with quote

hi

you cannot delete a esds record. pl correct me if iam wrong
Back to top
View user's profile Send private message
nuthan

Active User


Joined: 26 Sep 2005
Posts: 146
Location: Bangalore

PostPosted: Mon Feb 06, 2006 3:22 pm    Post subject:
Reply with quote

Hi,
i think U cant delete an ESDS record but u can rewrite with another record of same Length.
Back to top
View user's profile Send private message
khamarutheen

Active Member


Joined: 23 Aug 2005
Posts: 680
Location: NJ

PostPosted: Mon Feb 06, 2006 3:34 pm    Post subject: ESDS Delete
Reply with quote

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
View user's profile Send private message
dneufarth

Active User


Joined: 27 Apr 2005
Posts: 239
Location: Cincinnati OH USA

PostPosted: Tue Feb 07, 2006 8:47 am    Post subject:
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Full Time COBOL Software Development ... shally Mainframe Jobs 0 Fri Jan 20, 2017 5:24 am
This topic is locked: you cannot edit posts or make replies. COBOL Software Development Lead at Fi... shally Mainframe Jobs 0 Fri Jan 20, 2017 5:21 am
No new posts Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm
No new posts OO COBOL compile error Virendra Shambharkar COBOL Programming 3 Tue Jan 10, 2017 6:05 pm
No new posts Need Suggestion on COBOL program vickey_dw COBOL Programming 5 Thu Jan 05, 2017 10:55 pm


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