|
|
[FILE ]
work-file-number |
[VARIABLE ]
operand1
|
|||||||||
COMMAND
operand2
|
This document covers the following topics:
For an explanation of the symbols used in the syntax diagram, see Syntax Symbols.
Related Statements: CLOSE PC
FILE
| UPLOAD PC
FILE
| WRITE WORK
FILE
Belongs to Function Group: Control of Work Files / PC Files
This statement is used to transfer data from a mainframe platform to the PC.
See also the Natural Connection and Entire Connection documentation
Operand Definition Table:
Operand | Possible Structure | Possible Formats | Referencing Permitted | Dynamic Definition | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
operand1
|
C | S | A | G | A | U | N | P | I | F | B | D | T | L | C | yes | no | |
operand2
|
C | S | A | yes | yes |
Neither Format C not G is valid for Natural Connection.
Syntax Element Description:
Syntax Element | Description |
---|---|
work-file-number
|
Work File Number:
The work file number to be used. This number must correspond to one of the work file numbers for the PC as defined to Natural. |
VARIABLE
|
Variable Format:
The records in the PC file will be written in variable format. Note that variable records cannot be converted to PC spreadsheet formats. |
operand1
|
Field Specification:
With |
COMMAND
|
COMMAND Clause:
With the Entire Connection checks whether the command sent is valid or not. A command that cannot be recognized by the PC is rejected. In this case, Natural issues the error message that the downloaded command was rejected by the PC. You can use the DOWNLOAD PC FILE 7 COMMAND 'DIR' In Example
2 below, the |
operand2
|
COMMAND Specification:
With |
SYNC
|
SYNC Option:
With |
ASYNC
|
ASYNC Option:
With |
The following program demonstrates the use of the DOWNLOAD
PC FILE
statement. The data is first selected and then downloaded to the
PC by using Work File 7.
** Example 'PCDOEX1': DOWNLOAD PC FILE ** ** NOTE: Example requires that Natural Connection is installed. ************************************************************************ DEFINE DATA LOCAL 01 PERS VIEW OF EMPLOYEES 02 PERSONNEL-ID 02 NAME 02 CITY END-DEFINE * FIND PERS WITH CITY = 'NEW YORK' /* Data selection DOWNLOAD PC FILE 7 CITY NAME PERSONNEL-ID /* Data download END-FIND END
When you run the program, a window appears in which you specify the name of the PC file into which the data is to be downloaded. The data is then downloaded to the PC.
The following program demonstrates the use of the
COMMAND
clause in the DOWNLOAD PC FILE
statement. The
name of the receiving PC file is first defined. Then the data is selected and
downloaded to this file.
** Example 'PCDOEX2': DOWNLOAD PC FILE ** ** NOTE: Example requires that Natural Connection is installed. ************************************************************************ DEFINE DATA LOCAL 01 PERS VIEW OF EMPLOYEES 02 PERSONNEL-ID 02 NAME 02 CITY 01 CMD (A80) /* Variable for transfer END-DEFINE /* of the PC command * MOVE 'SET PCFILE 7 DOWN DATA PERS.NCD' TO CMD /* PC command to define * DOWNLOAD PC FILE 6 COMMAND CMD /* Command download * FIND PERS WITH CITY = 'NEW YORK' /* Data selection DOWNLOAD PC FILE 7 CITY NAME PERSONNEL-ID /* Data download END-FIND END
Note:
The PC file number in two successive DOWNLOAD PC
FILE
statements must be different.
When you run the program, the data is downloaded to the PC file that was specified in the program. A window does not appear.