Yes, you can declare files with the DCLF command. You can read them with the RCVF command.
For a display file, use the SNDRCVF command to output the screen format to the screen.
---------------------------------------------------------------
Specifically, if you have a *DSPF SIMPLEDSPF with field CHAR defined and a PF SIMPLEFILE with field CHAR defined then you can:
<pre>
PGM
DCLF FILE(SIMPLEDSPF) OPNID(DSPFILE)
DCLF FILE(SIMPLEFILE) OPNID(DBFILE)
RCVF OPNID(DBFILE)
CHGVAR VAR(&DSPFILE_CHAR) VALUE(&DBFILE_CHAR)
SNDRCVF OPNID(DSPFILE)
ENDPGM
</pre>
Last Wiki Answer Submitted: December 16, 2008 4:19 pm by Cwc4,275 pts.
If you live outside the United States, by submitting your email address you consent to having your personal data transferred to and processed in the United States.
To clarify, either one can be declared but not both at the same time. You can only declare one file in a CL program.
You can declare up to five files in a CL procedure or original program model (OPM) program. The DCLF command has the following parameters: