DOWNLOAD
|
PC
|
[FILE ]
work-file-number
|
[VARIABLE ]
operand1
|
|||||||||
WRITE |
WORK |
COMMAND
operand2
|
SYNC
|
|||||||||
ASYNC |
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:
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 | 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 operand1 you specify the fields to be downloaded to the PC. |
COMMAND |
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 operand2 you specify the DOS command or Entire Connection task that is to be executed on the PC. operand2 must be an alphanumeric constant or variable. |
SYNC | With SYNC , you specify that the PC returns control
to Natural after executing and terminating COMMAND .
SYNC can be used, for example, to ensure that the command
SET PCFILE has been executed before a file transfer
starts.
|
ASYNC | With ASYNC , you specify that the PC immediately
returns control to Natural, regardless of whether the execution of
COMMAND has terminated or not.
|
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.