The command CRF creates an empty file on PC.
Do not forget to finalize the creation of the file with the ENF command.
This file can then be used as a data file on
the PC.
The file can be filled programmatically with the NCL, NLN and VAL commands.
Or we can use the DBFXFER command for the transfer of a database file.
Syntax
CHGVAR |
VAR(&CMD) VALUE('CRF') |
CHGVAR |
VAR(&PARM1) VALUE('File') |
CHGVAR |
VAR(&PARM2) VALUE(' ') |
|
|
CALL |
PGM(LNCCMD) PARM(&HANDLE &CMD &OPT &PARM1 &PARM2 &RESULT) |
Parameters
Parameters |
|
Parm1 |
Complete path of the file to create. |
|
Example 1
LNCCMD CMD(CRF) PARM1('C:\A\fusion2.txt')
LNCCMD CMD(NCL) PARM1('Lastname')
LNCCMD CMD(NCL) PARM1('Firstname')
LNCCMD CMD(NCL) PARM1('Id')
LNCCMD CMD(NLN)
LNCCMD CMD(VAL) PARM1('Lastname') PARM2('Redfall')
LNCCMD CMD(VAL) PARM1('Firstname') PARM2('Robert')
LNCCMD CMD(VAL) PARM1('Id') PARM2('1')
LNCCMD CMD(ENF)
LNCCLOSE
In this example, the file 'fusion2.txt' is created in the directory "C: \ A".
Example 2
LNCOPEN
LNCCMD CMD(CRF) PARM1('C:\A\fusion.txt')
LNCCMD CMD(ENF)
LNCCMD CMD(DBFXFER) PARM1('FILE="C:\A\fusion.txt"') +
PARM2('SQL:select CUST_ID as Identifiant, +
FIRSTNAME as Prenom, LASTNAME as Nom from +
SP_CUST')
LNCCLOSE
See also
• ENF
• NCL
• NLN
• VAL
• DBFXFER