MARINA JOSEPH
New User
Joined: 11 Jun 2009 Posts: 61 Location: chennai
|
|
|
|
Hi all,
Can some somebody tell me if the below syntax for random access of an RRDS file is correct?
Deleting from an RRDS file is possible. But it is not possible to delete from an ESDS file.
RRDS – Random Access
/*Read RRDS file */
EXEC CICS READ DATASET('RRDS')
RIDFLD(RRDS-KEY)
INTO(DUMMY-AREA)
UPDATE
RRN
RESP(WS-RESP)
END-EXEC.
/*Update RRDS file*/
EXEC CICS REWRITE DATASET('RRDS')
FROM(WS-FILE-VAR)
RESP(WS-RESP)
END-EXEC.
/*Write RRDS file */
EXEC CICS WRITE DATASET('RRDS')
RIDFLD(RRDS-KEY)
FROM(WS-FILE-VAR)
RRN
RESP(WS-RESP)
END-EXEC.
/* Delete RRDS file*/
EXEC CICS DELETE DATASET('RRDS')
RIDFLD(RRDS-KEY)
RRN
RESP(WS-RESP)
END-EXEC.
Thanks,
Marina. |
|
Bill O'Boyle
Senior Member
Joined: 14 Jan 2008 Posts: 1247 Location: South Carolina, USA
|
|
|
|
Yes, a cursory look indicates the syntax is fine, but you should review the appropriate manual to be sure.
One word of caution; when you DELETE a record (other than ESDS which does not allow deletes), good practice and good technique dictates that you must first read the record for UPDATE, then followed by the DELETE or (if you don't want to issue the DELETE), then issue an UNLOCK.
Try not to leave a record in UPDATE mode for too long, because you are not just locking the record, you are locking the entire CONTROLINTERVAL where this record and potentially many others, reside.
You'll be glad you did....
Regards, |
|