UPLOAD PC FILE inside Natural 6.1.1 (Windows)

I am posting my problem here since I wasn’t sure if there is another place I could post this. My problem is directly related to Natural 6.1.1. I would certainly appreciate any ideas you might have. A description of my problem is detailed below.

In the relation to my problem, I am using Natural 6.1.1 (Windows) and I am receiving the error below when I try to execute the UPLOAD PC FILE statement to upload data from a text file outside of Natural.

Error:

NAT1599 Attempt to execute READ/WRITE WORK to non-existent file.
-------------------------------------------------------------------------------
TEXT:
Attempt to READ/WRITE WORK to non-existent file.
EXPL:
The work file specified in the job control does not exist.
ACTN:
Check allocation of work files.

===============================

Below is the code from my program that I am using to do the upload. I receive the NAT1599 at the UPLOAD PC FILE statement.

DEFINE DATA
LOCAL
01 EMPLOYEE VIEW OF EMPL-FILE
02 SSN
02 LAST-NAME
02 FIRST-NAME
02 MIDDLE-INITIAL
01 #SSN (A9)
01 #WORK-FILE
02 #WF-SSN (N9)
02 #WF-LAST-NAME (A25)
02 #WF-FIRST-NAME (A25)
02 #WF-MIDDLE-INITIAL (A1)
END-DEFINE
UPLOAD PC FILE 7 #WORK-FILE(*)
.
.
.
END-WORK
END

I think the problem may be with how my work file is setup but I’m not sure. Could this be true? Do you have any ideas on how I can go about correcting this problem?

Thanks.

Hi Brad,

you should define the work file to the Natural Profile you are using for your Natural session. You’ll most likely be using the default profile, which is NATPARM.

To fix the problem start the Natural Configuration Utility and then follow these steps:

Step 1: Select the “NATPARM” profile
Step 2: Select the “Natural Execution Configuration” parameter
Step 3: Select “Workfiles”
Step 4: Select “Work Files” this time
Step 5: Select the work file you want to open, in this instance it will be work file 7.
Step 6: Select the work file type, if it is a normal ASCII file then select “ASCII” or “Default”
Step 7: Select the “Close Mode”. You can leave it on “Auto”, if you select “User” you will have to issue an explicit “Close Work” statement in your program.
Step 8: Select the work file you want to open and upload from your program.
Step 9: Save the “NATPARM” profile and open a new Natural session. When you execute your program now it should read the content of the work file.

Hope this helps.

Regards
Theo

Hi Theo,
I wanted to offer a delayed thanks. I completed the steps you posted previously and it worked like a charm.

Thanks again.
Brad