PMS Information Systems
Welcome to PMS Information Systems - IBM i (AS/400) Forum !!!

Get Answers for all your queries on IBM i (AS/400).

Join the forum, it's quick and easy

PMS Information Systems
Welcome to PMS Information Systems - IBM i (AS/400) Forum !!!

Get Answers for all your queries on IBM i (AS/400).
PMS Information Systems
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Declaring two files

2 posters

Go down

Declaring two files Empty Declaring two files

Post  Vanithadevi Thu Oct 01, 2009 8:27 pm

Can we declare more than one file in a CL program using DCLF?


Regards,
Vanitha.

Vanithadevi

Posts : 14
Join date : 2009-07-29
Age : 39
Location : Chennai

Back to top Go down

Declaring two files Empty Re: Declaring two files

Post  muthuraman Thu Oct 01, 2009 8:37 pm

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.

muthuraman

Posts : 42
Join date : 2009-08-28

Back to top Go down

Declaring two files Empty Declaring more files

Post  Vanithadevi Mon Oct 05, 2009 8:55 pm

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).

Vanithadevi

Posts : 14
Join date : 2009-07-29
Age : 39
Location : Chennai

Back to top Go down

Declaring two files Empty Re: Declaring two files

Post  Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum