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
 

 

Reading ESDS file sequentially in CICS
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS
View previous topic :: :: View next topic  
Author Message
ssowmya

New User


Joined: 10 Oct 2006
Posts: 40

PostPosted: Thu Mar 29, 2007 12:26 pm    Post subject: Reading ESDS file sequentially in CICS
Reply with quote

Hi

I need to read a ESDS file and delete records if present in the file. I tried with a Start Browse and read next. But I receive ILLOGIC error when trying to start browse the file.

The code is:

EXEC CICS STARTBR DATASET('FILENAME')
RIDFLD(DUMMY-KEY)
END-EXEC.

EXEC CICS READNEXT DATASET ('FILENAME')
INTO(BOPFN24-RECORD)
RIDFLD(DUMMY-KEY)
END-EXEC.

EIBRESP and EIBRESP2 received are 21 and 110 respectively. Should ESDS files be processed differently??? Please help....
Back to top
View user's profile Send private message

William Thompson

Global Moderator


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

PostPosted: Thu Mar 29, 2007 1:11 pm    Post subject:
Reply with quote

Of course you got an ILLOGIC error, just what sort of key did you expect to find in an ESDS file?
And you will not be able to delete records from an ESDS file, only "mark" them for later dropping during a backup/restore.
Back to top
View user's profile Send private message
ssowmya

New User


Joined: 10 Oct 2006
Posts: 40

PostPosted: Thu Mar 29, 2007 1:18 pm    Post subject: Re: Reading ESDS file sequentially in CICS
Reply with quote

The key has zero values only.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


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

PostPosted: Thu Mar 29, 2007 1:32 pm    Post subject:
Reply with quote

Again, what sort of key did you expect to find in an ESDS file?
ESDS can be read by RBA or just sequentially but not by key (without an AIX).
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Thu Mar 29, 2007 1:36 pm    Post subject:
Reply with quote

Is the key always in the same position within the ESDS records, because if they are, then William's mention of an AIX might save you some processing time and resource.

If you overlay the ESDS with an AIX keyed to the appropriate position then you need only flag for delete all of the records matching the selection criteria, rather than read the whole file sequentially.
Back to top
View user's profile Send private message
ssowmya

New User


Joined: 10 Oct 2006
Posts: 40

PostPosted: Thu Mar 29, 2007 1:49 pm    Post subject: Re: Reading ESDS file sequentially in CICS
Reply with quote

If I dont provide RIDFLD() value, my compiler is not compiling the program successfully.

Can you please provide me the syntax of reading an ESDS file from first record sequentially in CICS.
Back to top
View user's profile Send private message
ssowmya

New User


Joined: 10 Oct 2006
Posts: 40

PostPosted: Thu Mar 29, 2007 1:52 pm    Post subject: Re: Reading ESDS file sequentially in CICS
Reply with quote

Also about deletion of record in ESDS....Can you also tell me how to mark the record for deletion?
When will the records be deleted ? When the CICS is bought down?

Will the marked records be processed when the file is read again?

I am new to ESDS...Have worked with KSDS only.

Please help me....
Back to top
View user's profile Send private message
William Thompson

Global Moderator


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

PostPosted: Thu Mar 29, 2007 1:53 pm    Post subject:
Reply with quote

That is because RIDFLD is required for STARTBR.
Look at accessing by relative record.
Back to top
View user's profile Send private message
ssowmya

New User


Joined: 10 Oct 2006
Posts: 40

PostPosted: Thu Mar 29, 2007 2:35 pm    Post subject: Re: Reading ESDS file sequentially in CICS
Reply with quote

Hi

Now I am able to Start browse & Read Next. How can I mark the record for deletion??? Please help me....
Back to top
View user's profile Send private message
William Thompson

Global Moderator


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

PostPosted: Thu Mar 29, 2007 2:38 pm    Post subject:
Reply with quote

How you mark them is up to you. You need to mark them in such a way that your later processing will consider them "deleted" and skip them.
Back to top
View user's profile Send private message
ssowmya

New User


Joined: 10 Oct 2006
Posts: 40

PostPosted: Thu Mar 29, 2007 3:53 pm    Post subject: Re: Reading ESDS file sequentially in CICS
Reply with quote

You mean, we need to have a flag in the file which needs to be set when the record should no longer be processed??? Can we be able to rewrite in an ESDS file??

So the only way to empty records is to delete define the file is it???
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Thu Mar 29, 2007 4:11 pm    Post subject:
Reply with quote

The way that KSDS works is that if you issue a delete for a record, it is flagged as being deleted and is changed internally, don't ask me how, so that it no longer accessible for either random or sequential access.

When the file is reorg'd - EXPORT/IMPORT or REPRO out / REPRO in, the records flagged as deleted are not copied out of the file, so will not be copied back into the file - they are then physically deleted from the file.

How this works with ESDS I don't remember, but obviously you can delete records from an ESDS file, and you can rewrite records.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


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

PostPosted: Thu Mar 29, 2007 6:45 pm    Post subject:
Reply with quote

expat wrote:
The way that KSDS works is that if you issue a delete for a record, it is flagged as being deleted and is changed internally, don't ask me how, so that it no longer accessible for either random or sequential access.
Not quite, the deleted record if physically removed from the CI and the hole is transfered to the rear for later use.
Quote:
How this works with ESDS I don't remember, but obviously you can delete records from an ESDS file, and you can rewrite records.
Again, not quite, ESDS is like PS in the respect that there can be no holes. Yes, you can rewrite them but deleting is only "logical", flagged somehow in a way all users of the file agree to honor.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Thu Mar 29, 2007 6:53 pm    Post subject:
Reply with quote

Quote:
Not quite, the deleted record if physically removed from the CI and the hole is transfered to the rear for later use.

I would question this point on the grounds that if this were the case the KSDS would be shuffling records around the CI at every deletion, which would add a whole lot of workload to the DASD subsystem and possibly the operating system too.

I would say that the delete process for either ESDS or KSDS is logical until file reorg time.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


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

PostPosted: Thu Mar 29, 2007 6:58 pm    Post subject:
Reply with quote

VSAM's primary I/O unit is the CI. After deleting a record, the hole is filled from behind and the counter of freespace in the rear is updated. No index changes are needed since none of the internal records are listed in the index (only the highest one I think).
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Thu Mar 29, 2007 7:05 pm    Post subject:
Reply with quote

That's correct about the index - it only updates if the high value key for that CI/CA is changed.

I still maintain that the record is logically deleted in KSDS. RLS will lock and process at the record level rather than the CI.

I shall try and take a nose around the VSAM books and check on this, unless of course you have a readily available quote from the good book to save me the trouble.

Damn you man, you're coming close to shattering my illusions on KSDS processing icon_biggrin.gif
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Thu Mar 29, 2007 7:27 pm    Post subject:
Reply with quote

Quote:

RBAs might change when records are added, deleted, or changed in size.
With compressed files, the RBAs for compressed records are not predictable.
Therefore, access by RBA is not suggested for normal use.


Yep, I'll give you that one. It says so in the book.

Bloody hell, 30 years with mainframes and I still learn something new icon_wink.gif
Back to top
View user's profile Send private message
ssowmya

New User


Joined: 10 Oct 2006
Posts: 40

PostPosted: Fri Mar 30, 2007 10:12 am    Post subject: Re: Reading ESDS file sequentially in CICS
Reply with quote

Hi

I am unable to REWRITE into ESDS file. Could some one please help me...Can you provide me with syntax???

I do a start browse. Then read next of the record. When I try to rewrite after modifying certain fields, I get EIBRESP 16 and EIBRESP2 30.

Please help...
Back to top
View user's profile Send private message
ssowmya

New User


Joined: 10 Oct 2006
Posts: 40

PostPosted: Fri Mar 30, 2007 11:39 am    Post subject: CICS hanging when trying to update ESDS file
Reply with quote

Hi

I am reading a ESDS file sequentially and am trying to update it using rewrite. Please find the code below:

EXEC CICS READ DATASET ('FILENAME')
INTO(FILERECORD)
RIDFLD(DUMMY-KEY)
UPDATE
END-EXEC.

Modify value and then REWRITE record

EXEC CICS
REWRITE FILE('FILENAME')
FROM(FILERECORD)
END-EXEC

Please let me know where I am wrong. The program hangs when I give update option in READ statement. If I dont give UPDATE option, the read is successfull. But REWRITE fails with EIBRESP 16 and EIBRESP2 30. Am I missing something??? Is the problem with definition of CICS file??? Please help me...
Back to top
View user's profile Send private message
William Thompson

Global Moderator


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

PostPosted: Fri Mar 30, 2007 12:40 pm    Post subject:
Reply with quote

Do you reliase that manuals have a lot of answers in them?
INVREQ
A REWRITE command is issued for a file that has not had a previous READ UPDATE successfully issued (RESP2=30).

And, yes, READNEXT also has an UPDATE...... icon_wink.gif
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 -> CICS All times are GMT + 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts CICS START AND CANCEL blayek CICS 1 Wed Dec 07, 2016 3:27 am
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts How does a called pgm know if its cal... Graeme Westerman COBOL Programming 4 Tue Nov 29, 2016 9:25 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm


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