# Read/write work files localy with naturalone

**URL:** <https://techcommunity.softwareag.com/t/read-write-work-files-localy-with-naturalone/284428>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, NaturalONE\
**Created:** [October 10, 2023, 8:25pm UTC](https://techcommunity.softwareag.com/t/read-write-work-files-localy-with-naturalone/284428 "2023-10-10T20:25:35Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![gilberto\_hernandez](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/gilberto_hernandez/32/39518_2.png) [@gilberto\_hernandez](https://techcommunity.softwareag.com/u/gilberto_hernandez)\
**Post date:** [October 10, 2023, 8:25pm UTC](https://techcommunity.softwareag.com/t/read-write-work-files-localy-with-naturalone/284428/1 "2023-10-10T20:25:35Z")

</div>

I want to know how can I set Work files 1 and 2. I want to be able to read and write a work file localy in my PC with NaturalOne.

Using natural one version 10

#### _Error messages / **full error** message screenshot / **log** file:_

#### _Question related to a **free trial** , or to a **production (customer)** instance?_

---

<div class="post-metadata">

**Author:** ![wolfgang.winter](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/wolfgang.winter/32/17954_2.png) [@wolfgang.winter](https://techcommunity.softwareag.com/u/wolfgang.winter)\
**Post date:** [October 10, 2023, 9:02pm UTC](https://techcommunity.softwareag.com/t/read-write-work-files-localy-with-naturalone/284428/2 "2023-10-10T21:02:47Z")

</div>

`DEFINE WORK FILE n '<filename>'`

---

<div class="post-metadata">

**Author:** ![gilberto\_hernandez](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/gilberto_hernandez/32/39518_2.png) [@gilberto\_hernandez](https://techcommunity.softwareag.com/u/gilberto_hernandez)\
**Post date:** [October 11, 2023, 1:46pm UTC](https://techcommunity.softwareag.com/t/read-write-work-files-localy-with-naturalone/284428/3 "2023-10-11T13:46:23Z")

</div>

Thanks for your help Wolfgang. I am getting the followin error message:

NAT1509 DYNAMIC ALLOCATION FOR WORK FILE FAILED CMWKF01.RC:035C 0002

I am not sure if it is neccesary to define or set something before oppenning naturalone session at the natparm or any other place.

---

<div class="post-metadata">

**Author:** ![Douglas\_Kelly](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/douglas_kelly/32/102_2.png) [@Douglas\_Kelly](https://techcommunity.softwareag.com/u/Douglas_Kelly)\
**Post date:** [October 11, 2023, 2:34pm UTC](https://techcommunity.softwareag.com/t/read-write-work-files-localy-with-naturalone/284428/4 "2023-10-11T14:34:15Z")

</div>

IBM reports:  
|035C|(860)| **Meaning:** Invalid PARM specified in text unit. The accompanying message IKJ56231I identifies the text unit in error. (all dynamic allocation functions)2

**Application programmer action:** See the description of the text unit and correct the error.

**Corresponding message:** IKJ56231I|  
Do you have the IKJ56231I error message (it might show up on your NDV server task)?

Can you show what is in your program’s DEFINE WORK FILE statement? Also note that the program is executing in your NDV server on the mainframe, not on your PC, so it can’t access PC files directly without Natural Connection. Your other option is to transfer the PC file to the mainframe and supply the mainframe file name to your DEFINE WORK FILE statement.

---

<div class="post-metadata">

**Author:** ![gilberto\_hernandez](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/gilberto_hernandez/32/39518_2.png) [@gilberto\_hernandez](https://techcommunity.softwareag.com/u/gilberto_hernandez)\
**Post date:** [October 11, 2023, 3:29pm UTC](https://techcommunity.softwareag.com/t/read-write-work-files-localy-with-naturalone/284428/5 "2023-10-11T15:29:51Z")

</div>

Hi Douglas, thanks for your information.

DEFINE WORK FILE 1 ‘C:\USERS\B726222\WORKFILES\BANCO.CSV’ TYPE ‘CSV’  
RD1. READ (100) BTRM1BCO BY CIM1-SWIFT  
DISPLAY BTRM1BCO  
COMPRESS CIM1-SWIFT ‘;’  
CIM1-CODSUC ‘;’  
CIM1-CTAMAY  
INTO #WORKILE LEAVING NO  
WRITE WORK FILE 1 #WORKILE  
END-READ  
CLOSE WORK FILE 1  
END

this is the code, it is very simple, but I am no using natural connection. I didn’t know it would be required. Thanks for your help.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 8, 2024, 3:30pm UTC](https://techcommunity.softwareag.com/t/read-write-work-files-localy-with-naturalone/284428/6 "2024-04-08T15:30:09Z")

</div>

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
