View previous topic :: View next topic
|
Author |
Message |
ssowmya
New User
Joined: 10 Oct 2006 Posts: 40
|
|
|
|
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 |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
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 |
|
|
ssowmya
New User
Joined: 10 Oct 2006 Posts: 40
|
|
|
|
The key has zero values only. |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
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 |
|
|
ssowmya
New User
Joined: 10 Oct 2006 Posts: 40
|
|
|
|
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 |
|
|
ssowmya
New User
Joined: 10 Oct 2006 Posts: 40
|
|
|
|
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 |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
That is because RIDFLD is required for STARTBR.
Look at accessing by relative record. |
|
Back to top |
|
|
ssowmya
New User
Joined: 10 Oct 2006 Posts: 40
|
|
|
|
Hi
Now I am able to Start browse & Read Next. How can I mark the record for deletion??? Please help me.... |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
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 |
|
|
ssowmya
New User
Joined: 10 Oct 2006 Posts: 40
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
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 |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
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 |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
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 |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
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 |
|
Back to top |
|
|
ssowmya
New User
Joined: 10 Oct 2006 Posts: 40
|
|
|
|
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 |
|
|
ssowmya
New User
Joined: 10 Oct 2006 Posts: 40
|
|
|
|
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 |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
1. Check the response of the READ command. Was it successful?
O. |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
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 |
|
|
|