Preparing to Use Natural Connection

This document describes the tasks that must be accomplished to allow download and upload.

In order to download and upload data, a work file must be designated as a PC file.

To download reports, a printer must be designated as a PC printer.


Displaying Work File and Printer Settings

To display your current work file and printer settings, enter the Natural system command SYSFILE at the NEXT prompt. This invokes the SYSTP utility and a screen similar to the following appears:

11:07:18              ***** NATURAL SYSTP UTILITY *****             2005-06-16
 User SAG                  - Work File Information -             TID DAEFTCI7  
                                                                               
 M No.   Type      Name   Recfm  Lrecl  Blksz  Status                          
 ------------------------------------------------------------------------------
    1  COMPLETE  CMWKF01   VB            4628  Available for Input/Output      
    2  COMPLETE  CMWKF02   VB            4628  Available for Input/Output      
    3  COMPLETE  CMWKF03   VB            4628  Available for Input/Output      
    4  COMPLETE  CMWKF04   VB            4628  Available for Input/Output      
    5  PC                  VB            4628  Available for Input/Output      
    6  PC                  VB            4628  Available for Input/Output      
    7  PC                  VB            4628  Available for Input/Output      
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               
                                                                               
   Top of List                                                                 
Command ===>                                                                   
Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
Cont  Help  Menu  Exit  Sel   Pos   --    -     +     ++    Print Work  Canc

The standard PC files are work files 5, 6 and 7 as shown in the example above. For more information, see SYSTP Utility in the Utilities documentation.

Defining Work Files and Printers

You can define work files and printers statically in your Natural parameter module, or dynamically when invoking Natural:

  • Work Files
    Use the NTWORK macro or WORK parameter for work file definitions.

  • Printers
    Use the NTPRINT macro or PRINT parameter for printer definitions.

For detailed information on these macros and parameters, see the Parameter Reference.

Remember, however, that the download and upload modules provided by Natural Connection use work file 7. For further information on transferring Natural objects, see Data Transfer which is part of the Terminal Emulation section of the Entire Connection documentation.

Activating the PC Connection

To upload and download data to/from a PC, the PC connection must be active. You activate the PC connection from the mainframe.

Start of instruction setTo activate the PC connection

  • Use the Natural terminal command %+.

    Or:
    Invoke Natural with the dynamic parameter PC=ON.

    Or:
    Use the SET CONTROL '+' statement in a Natural program.

With the terminal command %+, you can also set an additional option:

Option Description
%+N The PC connection is activated. In addition, no field names are sent when downloading or uploading data.

If you attempt to upload or download data without the PC connection being activated, a message appears indicating that the PC connection is not active.

If you enter %+ and the PC connection is already active, a message appears indicating that the PC connection is already active.

Deactivating the PC Connection

Start of instruction setTo deactivate the PC connection

  • Use the Natural terminal command %-.

    Or:
    Use the SET CONTROL '-' statement in a Natural program.