IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Reading ESDS file sequentially in CICS


IBM Mainframe Forums -> CICS
Post new topic   Reply to topic
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
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: 3156
Location: Tucson AZ

PostPosted: Thu Mar 29, 2007 1:11 pm
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
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: 3156
Location: Tucson AZ

PostPosted: Thu Mar 29, 2007 1:32 pm
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: 8796
Location: Welsh Wales

PostPosted: Thu Mar 29, 2007 1:36 pm
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
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
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: 3156
Location: Tucson AZ

PostPosted: Thu Mar 29, 2007 1:53 pm
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
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: 3156
Location: Tucson AZ

PostPosted: Thu Mar 29, 2007 2:38 pm
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
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: 8796
Location: Welsh Wales

PostPosted: Thu Mar 29, 2007 4:11 pm
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: 3156
Location: Tucson AZ

PostPosted: Thu Mar 29, 2007 6:45 pm
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: 8796
Location: Welsh Wales

PostPosted: Thu Mar 29, 2007 6:53 pm
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: 3156
Location: Tucson AZ

PostPosted: Thu Mar 29, 2007 6:58 pm
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: 8796
Location: Welsh Wales

PostPosted: Thu Mar 29, 2007 7:05 pm
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: 8796
Location: Welsh Wales

PostPosted: Thu Mar 29, 2007 7:27 pm
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
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
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: 3156
Location: Tucson AZ

PostPosted: Fri Mar 30, 2007 12:40 pm
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
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Sun Apr 01, 2007 9:24 am
Reply with quote

1. Check the response of the READ command. Was it successful?

O.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


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

PostPosted: Sun Apr 01, 2007 12:05 pm
Reply with quote

ssowmya wrote:
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...
Very possible, is the file defined for update?
CEMT I DAT('FILENAME')
What is the EIBRESP and EIBRESP2 after the REWRITE?
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CICS

 


Similar Topics
Topic Forum Replies
No new posts Unable to interpret a hex value to De... COBOL Programming 4
No new posts Associating a USERID with a CICS-Libe... CICS 0
No new posts omegamon for cics -UNSUPPORTED ENVIRO... CICS 2
No new posts Help needed in automation cics transa... CLIST & REXX 1
No new posts How to Login in to cics region and is... CICS 9
Search our Forums:

Back to Top