Declaring two files
2 posters
Page 1 of 1
Declaring two files
Can we declare more than one file in a CL program using DCLF?
Regards,
Vanitha.
Regards,
Vanitha.
Vanithadevi- Posts : 14
Join date : 2009-07-29
Age : 39
Location : Chennai
Re: Declaring two files
Yes Vanitha.we can have up to 5 DCLF statements in a CL as display files or database file.
The Declare File (DCLF) command declares one file (by name) to a Control Language (CL) program. Up to five DCLF commands are allowed in a CL program or ILE CL procedure. Each DCLF command specifies the name of a display file or database file.
The Declare File (DCLF) command declares one file (by name) to a Control Language (CL) program. Up to five DCLF commands are allowed in a CL program or ILE CL procedure. Each DCLF command specifies the name of a display file or database file.
muthuraman- Posts : 42
Join date : 2009-08-28
Declaring more files
Muthuraman is correct.From V5R3 We will be allowed to use more than one DCLF and a maximum of five DCLF commands. We can declare both a database file and a display file in a CL procedure and also able to process the same file more than once by declaring it multiple times.
For this we need to add a new parameter, OPNID.You must specify an identifying name for the file.
E.g:
Suppose you specify OPNID(WORKF) when declaring file WORKFILE, which has fields MBRNAME, MBRTYPE, and MBRSIZE.
DCLF FILE(WORKFILE) OPNID(WORKF)
The CL compiler will generate variables named &WORKF_MBRNAME, &WORKF_MBRTYPE, and &WORKF_MBRSIZE.
If you declare more than one file, you must use the OPNID parameter on all input-output commands: Declare File (DCLF), End Receive (ENDRCV), Receive File (RCVF), Send File (SNDF), Send/Receive File (SNDRCVF), and WAIT (Wait for input operation).
For this we need to add a new parameter, OPNID.You must specify an identifying name for the file.
E.g:
Suppose you specify OPNID(WORKF) when declaring file WORKFILE, which has fields MBRNAME, MBRTYPE, and MBRSIZE.
DCLF FILE(WORKFILE) OPNID(WORKF)
The CL compiler will generate variables named &WORKF_MBRNAME, &WORKF_MBRTYPE, and &WORKF_MBRSIZE.
If you declare more than one file, you must use the OPNID parameter on all input-output commands: Declare File (DCLF), End Receive (ENDRCV), Receive File (RCVF), Send File (SNDF), Send/Receive File (SNDRCVF), and WAIT (Wait for input operation).
Vanithadevi- Posts : 14
Join date : 2009-07-29
Age : 39
Location : Chennai
Similar topics
» More than one REF files
» DLTF Files
» Can we journal the files are in IFS?
» Files go Locally
» Physical Files
» DLTF Files
» Can we journal the files are in IFS?
» Files go Locally
» Physical Files
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum