# How to create Natural source from JCL

**URL:** <https://techcommunity.softwareag.com/t/how-to-create-natural-source-from-jcl/62095>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-on-Mainframes\
**Created:** [March 29, 2007, 12:06pm UTC](https://techcommunity.softwareag.com/t/how-to-create-natural-source-from-jcl/62095 "2007-03-29T12:06:49Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ramesh](https://avatars.discourse-cdn.com/v4/letter/r/d07c76/32.png) [@Ramesh](https://techcommunity.softwareag.com/u/Ramesh)\
**Post date:** [March 29, 2007, 12:06pm UTC](https://techcommunity.softwareag.com/t/how-to-create-natural-source-from-jcl/62095/1 "2007-03-29T12:06:49Z")

</div>

Hi,

Can anyone help in this.

When I submit a job I will be creating a dynamic Natural program in the dataset. Now I want to copy the natural program which is created in dataset dynamically into natural source. Is there any job to do the same. If so please provide sample JCL.

Thanks  
Ramesh

---

<div class="post-metadata">

**Author:** ![Klaus\_Sponagel](https://avatars.discourse-cdn.com/v4/letter/k/3bc359/32.png) [@Klaus\_Sponagel](https://techcommunity.softwareag.com/u/Klaus_Sponagel)\
**Post date:** [March 29, 2007, 4:23pm UTC](https://techcommunity.softwareag.com/t/how-to-create-natural-source-from-jcl/62095/2 "2007-03-29T16:23:13Z")

</div>

Here is a sample CMSYNIN to code a ad hoc program in a batch job:

```auto

//CMSYNIN DD *                 
LOGON KSP                      
EDT                            
DEFINE DATA LOCAL              
1 A(A10) INIT <'HELLO'>        
END-DEFINE                     
WRITE A 'WORLD'                
END                            
.E                             
RUN                            
```

EDT is the Natural line editor to use in batch. With .E you quit EDT. The source program remains in the source area and can be executed with the following RUN command.  
You can also insert a STOW ANYNAME to stow the source program.

I hope this helps.  
Klaus

---

<div class="post-metadata">

**Author:** ![Ramesh](https://avatars.discourse-cdn.com/v4/letter/r/d07c76/32.png) [@Ramesh](https://techcommunity.softwareag.com/u/Ramesh)\
**Post date:** [March 29, 2007, 4:37pm UTC](https://techcommunity.softwareag.com/t/how-to-create-natural-source-from-jcl/62095/3 "2007-03-29T16:37:18Z")

</div>

Thanks KLaus for quick response, actully my requirment is I have natural program in dataset, now I want to copy the program in natiral source and I have to run the program. when I copy the program into natural source then only I can give program name, but is there any job to do copy from dataset into natura source.

Hope u can understand.  
Thanks  
Ramesh

---

<div class="post-metadata">

**Author:** ![Jerome\_LeBlanc](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/jerome_leblanc/32/111_2.png) [@Jerome\_LeBlanc](https://techcommunity.softwareag.com/u/Jerome_LeBlanc)\
**Post date:** [March 29, 2007, 8:38pm UTC](https://techcommunity.softwareag.com/t/how-to-create-natural-source-from-jcl/62095/4 "2007-03-29T20:38:53Z")

</div>

Try this, instead of

//CMSYNIN DD \*

use

//CMSYNIN DD DATASET.NAME

Your dataset will need to include the LOGON LIBRARY, EDT, .E, and RUN lines in addition to the source code.

---

<div class="post-metadata">

**Author:** ![Ralph\_Zbrog](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/ralph_zbrog/32/78_2.png) [@Ralph\_Zbrog](https://techcommunity.softwareag.com/u/Ralph_Zbrog)\
**Post date:** [March 29, 2007, 11:19pm UTC](https://techcommunity.softwareag.com/t/how-to-create-natural-source-from-jcl/62095/5 "2007-03-29T23:19:56Z")

</div>

At various times and for various reasons, I maintain Natural source modules as members of a PDS. I like to separate source code from Natural commands, so my JCL looks like this:

```auto
//CMSYNIN DD *  
LOGON library 
EDT 
/* 
// DD DSN=my.pds.lib(########),DISP=SHR 
// DD * 
.E 
SA ######## 
FIN 
/* 
```

The commands exist only once, rather than in each source member.

In TSO, I use the following command string to load a module into a Natural library:

```auto
CH ALL '########' 'natmem';SUB;CAN
```

---

<div class="post-metadata">

**Author:** ![Ramesh](https://avatars.discourse-cdn.com/v4/letter/r/d07c76/32.png) [@Ramesh](https://techcommunity.softwareag.com/u/Ramesh)\
**Post date:** [March 30, 2007, 12:48pm UTC](https://techcommunity.softwareag.com/t/how-to-create-natural-source-from-jcl/62095/6 "2007-03-30T12:48:41Z")

</div>

Thanks Ralph Zbrog, Its working fine.  
If possinble Can you please provide explanation of steps in that JCL.

Thanks  
Ramesh

---

<div class="post-metadata">

**Author:** ![Eldon](https://avatars.discourse-cdn.com/v4/letter/e/3d9bf3/32.png) [@Eldon](https://techcommunity.softwareag.com/u/Eldon)\
**Post date:** [June 22, 2007, 7:49pm UTC](https://techcommunity.softwareag.com/t/how-to-create-natural-source-from-jcl/62095/7 "2007-06-22T19:49:43Z")

</div>

Rahesh, i get this in from system when I run your jcl:

Jun 22, 2007 National General Insurance Company  
08:54:41 AM Data Processing Department  
\*\*\*\*\*\*\*\*\*\*\*\*\*\* A Batch Program Processing Error Has Occurred  
End of file in input after continuation.  
Program  
Job TEMBNT22  
Application GPLUS  
Level 1  
Error Line  
Error Number 1124  
Contact NGI Data Processing

* * *

---

<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, 2:41pm UTC](https://techcommunity.softwareag.com/t/how-to-create-natural-source-from-jcl/62095/8 "2021-04-02T14:41:08Z")

</div>


