# delete object file before stow

**URL:** <https://techcommunity.softwareag.com/t/delete-object-file-before-stow/176573>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-Utilities\
**Created:** [May 22, 2014, 3:50pm UTC](https://techcommunity.softwareag.com/t/delete-object-file-before-stow/176573 "2014-05-22T15:50:49Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![mwessjoh](https://avatars.discourse-cdn.com/v4/letter/m/8797f3/32.png) [@mwessjoh](https://techcommunity.softwareag.com/u/mwessjoh)\
**Post date:** [May 22, 2014, 3:50pm UTC](https://techcommunity.softwareag.com/t/delete-object-file-before-stow/176573/1 "2014-05-22T15:50:49Z")

</div>

Hi,

is it possible to delete the old object file, bevor I’m stowing the new source file?

The best way would be, that I only stow the new sourcen and the old object file will be deleted automaticly.

When I have a bug in the source file, there will be no object file.

Is this possible?

Best regards,

Markus Wessjohann

---

<div class="post-metadata">

**Author:** ![Steve\_Robinson](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/steve_robinson/32/107_2.png) [@Steve\_Robinson](https://techcommunity.softwareag.com/u/Steve_Robinson)\
**Post date:** [May 22, 2014, 5:35pm UTC](https://techcommunity.softwareag.com/t/delete-object-file-before-stow/176573/2 "2014-05-22T17:35:35Z")

</div>

UNCAT

---

<div class="post-metadata">

**Author:** ![mwessjoh](https://avatars.discourse-cdn.com/v4/letter/m/8797f3/32.png) [@mwessjoh](https://techcommunity.softwareag.com/u/mwessjoh)\
**Post date:** [May 23, 2014, 12:55pm UTC](https://techcommunity.softwareag.com/t/delete-object-file-before-stow/176573/3 "2014-05-23T12:55:20Z")

</div>

Is it possible todo it with every STOW/CAT?

Without UNCAT ; CAT ?

---

<div class="post-metadata">

**Author:** ![Steve\_Robinson](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/steve_robinson/32/107_2.png) [@Steve\_Robinson](https://techcommunity.softwareag.com/u/Steve_Robinson)\
**Post date:** [May 24, 2014, 1:59pm UTC](https://techcommunity.softwareag.com/t/delete-object-file-before-stow/176573/4 "2014-05-24T13:59:49Z")

</div>

Hi Markus;

Sorry, I did not understand at first what you wanted. Hence, my one word response, UNCAT, was not what you were looking for. I have a solution for you; however before presenting it, let me tell you why I came up with the solution.

Years ago, I had an annoying problem. I teach Natural classes. I teach them “live”; that is I run code, not display powerpoints. Suppose I have a program, PROG1, in the editor. A student asks a question. To answer the question, I make a couple of changes to PROG1. Then I SAVE PROG2. Then I type R (I am a lazy typist). Perhaps another student suggests a change to the code. I make the change and type SA. WHOOPS. I have just overwritten PROG1, not PROG2. When you do SAVE PROG2, the name that appears at the top of the editing area is still PROG1.

I decided that what Natural needed was a SAVE AS editor command as well as SAVE. What to do? I created a simple program, called XX, shown below (it must be STOW’ed, not just SAVE’d):

DEFINE DATA LOCAL  
1 #NAME (A8 )  
END-DEFINE  
\*  
INPUT #NAME  
STACK TOP COMMAND ‘EDIT’ #NAME  
STACK TOP COMMAND ‘SAVE’ #NAME  
END

If I have PROG1 in the editor, and type the command XX PROG2, I am now working with PROG2 in the editor, not PROG1. This made life a lot simpler for me. I no longer destroyed programs in my teaching library.

What does this have to do with your problem? You can create a program like:

DEFINE DATA LOCAL  
1 #NAME (A8 )  
END-DEFINE  
\*  
INPUT #NAME  
STACK TOP COMMAND ‘STOW’  
STACK TOP COMMAND ‘UNCAT’ #NAME  
END

Call the program whatever you want (as a lazy typist I suggest a two character name like UN).

Now suppose you are working in the editor with PROG1. You type UN PROG1. The object code for PROG1 will disappear. The source code for PROG1 will be the “old” version of PROG1 (prior to any changes you made without saving). Of course, you can type SA to simply make the library source code the same as the program editor.

Natural can be a lot of fun to work with 😃

---

<div class="post-metadata">

**Author:** ![Matthias1](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@Matthias1](https://techcommunity.softwareag.com/u/Matthias1)\
**Post date:** [May 27, 2014, 2:10pm UTC](https://techcommunity.softwareag.com/t/delete-object-file-before-stow/176573/5 "2014-05-27T14:10:19Z")

</div>

> [@mwessjoh](#):
>
> When I have a bug in the source file, there will be no object file.

I thinks there’s no option to change the behaviour of STOW.

There’s just the simple formula:

STOW = CHECK + SAVE + CAT

If CHECK fails, no SAVE and no CAT is done.

---

<div class="post-metadata">

**Author:** ![mwessjoh](https://avatars.discourse-cdn.com/v4/letter/m/8797f3/32.png) [@mwessjoh](https://techcommunity.softwareag.com/u/mwessjoh)\
**Post date:** [June 10, 2014, 5:38pm UTC](https://techcommunity.softwareag.com/t/delete-object-file-before-stow/176573/6 "2014-06-10T17:38:28Z")

</div>

@Steve: Thanks, I try to intregrate this in my developing process, but I’m not using the terminal ☹

@Matthias: That’s right, but not exactly what I wanted.

Situation:

1. EDIT PROG1 with no error
2. STOW PROG1
3. EDIT PROG1 with error
4. SAVE PROG1
5. STOW PROG1 =\> no SAVE, no CAT

Now I have object files from Step 1. and the source from Step 4. To find this bugs are quite hard.

I thought there is a parameter, to do a UNCAT before very STOW/CAT.

Best regards,

Markus Wessjohann

---

<div class="post-metadata">

**Author:** ![Steve\_Robinson](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/steve_robinson/32/107_2.png) [@Steve\_Robinson](https://techcommunity.softwareag.com/u/Steve_Robinson)\
**Post date:** [June 10, 2014, 6:27pm UTC](https://techcommunity.softwareag.com/t/delete-object-file-before-stow/176573/7 "2014-06-10T18:27:25Z")

</div>

The problem is your Step 4.

If you are trying to keep source and object in synch, you should not use SAVE (or just CAT for that matter). You should instead do 4. STOW PROG1. This results in no changes to either source or object.

You still have the results of step 2 in your library.

If it is time to go home for the day, you can do a SAVE PROG1H , where the H means HOLD. When you come back the next day, E PROG1H and work from there.

---

<div class="post-metadata">

**Author:** ![Karlheinz\_Kronauer](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/karlheinz_kronauer/32/134_2.png) [@Karlheinz\_Kronauer](https://techcommunity.softwareag.com/u/Karlheinz_Kronauer)\
**Post date:** [June 11, 2014, 2:23pm UTC](https://techcommunity.softwareag.com/t/delete-object-file-before-stow/176573/8 "2014-06-11T14:23:04Z")

</div>

The best way to overcome this problem is using NaturalONE.  
If you work on source code in NaturalONE and then deploy it to a server, there is a  
parameter that can be set, that the source code is deleted after the stow on the server.  
this does mean, that you have always one location where your source code is stored namely in  
NaturalONE workspace and /or a repository like subversion.

---

<div class="post-metadata">

**Author:** ![mwessjoh](https://avatars.discourse-cdn.com/v4/letter/m/8797f3/32.png) [@mwessjoh](https://techcommunity.softwareag.com/u/mwessjoh)\
**Post date:** [June 11, 2014, 5:35pm UTC](https://techcommunity.softwareag.com/t/delete-object-file-before-stow/176573/9 "2014-06-11T17:35:38Z")

</div>

Sorry, we are using a different IDE.

---

<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 2, 2021, 3:31pm UTC](https://techcommunity.softwareag.com/t/delete-object-file-before-stow/176573/10 "2021-04-02T15:31:11Z")

</div>


