Re: Diffence between two CICS READ ; FILE & DATASET





Praveen wrote:
Hi,

I am a newbie in CICS COBOL. I came across two possible syntax to read
a file from a CICS program. The two syntax that I came across were

EXEC CICS
                READ DATASET ('RASSPLSW')
                     INTO    (RASSPLSW-RECORD)
                     RIDFLD  (W-USERID)
                     RESP    (W-RESP)
           END-EXEC.


EXEC CICS READ FILE('RASSPLSW') INTO(USRRECC) RIDFLD(CURRUSR) END-EXEC.

The two syntax mainly differ only in the use of FILE || DATASET. I
would like to know this diffence...


There is essentially no difference. FILE and DATASET mean the same thing in an EXEC CICS READ statement. You need to use one or the other to specify the FCT name of the file to be read, but not both.


At some point in the past IBM changed the syntax of EXEC CICS READ and recommended using FILE for all future READ commands, but they still had to support the DATASET keyword in order to allow older CICS programs to compile and execute without any source code changes.

I spent few minutes looking thru mvshelp.com and eventually found a CICS Application Programming Reference manual for CICS/Transaction Server 1.2 (a fairly recent release, although probably no longer supported) and it seems to expect the FILE keyword and does not even mention the DATASET keyword. I can assure you that I have CICS programs running under CICS/Transaction Server 2.2 and some of them use FILE and some use DATASET. Either usage will work, but the current manuals recommend using FILE rather than DATASET.

Hope that helps...


-- http://arnold.trembley.home.att.net/  .



Relevant Pages