# How to pass the data to Natural program through JCL.

**URL:** <https://techcommunity.softwareag.com/t/how-to-pass-the-data-to-natural-program-through-jcl/80144>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-Code-Samples\
**Created:** [February 11, 2009, 2:05pm UTC](https://techcommunity.softwareag.com/t/how-to-pass-the-data-to-natural-program-through-jcl/80144 "2009-02-11T14:05:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![vijay](https://avatars.discourse-cdn.com/v4/letter/v/4bbf92/32.png) [@vijay](https://techcommunity.softwareag.com/u/vijay)\
**Post date:** [February 11, 2009, 2:05pm UTC](https://techcommunity.softwareag.com/t/how-to-pass-the-data-to-natural-program-through-jcl/80144/1 "2009-02-11T14:05:48Z")

</div>

Hi All,

How to pass the data to Natural program through JCL.

---

<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:** [February 11, 2009, 5:39pm UTC](https://techcommunity.softwareag.com/t/how-to-pass-the-data-to-natural-program-through-jcl/80144/2 "2009-02-11T17:39:00Z")

</div>

education, education, education !!!

[http://techcommunity.softwareag.com/ecosystem/documentation/natural/nat425mf/parms/stack.htm#fisanchor0](http://techcommunity.softwareag.com/ecosystem/documentation/natural/nat425mf/parms/stack.htm#fisanchor0)

also, you might try asking your dba.

steve

---

<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:** [February 11, 2009, 10:26pm UTC](https://techcommunity.softwareag.com/t/how-to-pass-the-data-to-natural-program-through-jcl/80144/3 "2009-02-11T22:26:05Z")

</div>

Presuming that you’re using IBM JCL, passing a couple of values would look something like this:

```auto
//CMSYNIN DD *
LOGON library
pgmname value1,value2
/*
```

For more than a few values, you can start on a separate line:

```auto
//CMSYNIN DD *
LOGON library
pgmname
value1,value2,value3,value4,value5,value6
/*
```

The values are separated by the delimiter character, and follow the order of the variables on the corresponding INPUT statement in your program (left to right, top to bottom). If executing in Forms Mode, each line of values on the map is represented as a separate line of input data in the JCL. If executing in Delimiter Mode, all values are placed on a single line in the JCL. If the “single line” is longer than 72 characters, it can be continued onto more physical lines by using the continuation character.

```auto
//CMSYNIN DD *
LOGON library
pgmname
value1,value2,value3,%
value4,value5,value6
```

---

<div class="post-metadata">

**Author:** ![jwilhelm](https://avatars.discourse-cdn.com/v4/letter/j/3ec8ea/32.png) [@jwilhelm](https://techcommunity.softwareag.com/u/jwilhelm)\
**Post date:** [August 11, 2009, 7:09pm UTC](https://techcommunity.softwareag.com/t/how-to-pass-the-data-to-natural-program-through-jcl/80144/4 "2009-08-11T19:09:53Z")

</div>

You can add multiple cards after the //SYSIN DD \*  
and in the program use the INPUT statement.

in the jcl following the  
//SYSIN DD \*  
PROGRAMNAME  
programnCC  
TERMINATE = 20  
WORK FILE = WORK.FILE.NAME  
EXE FILE = executiblename  
DISPLAYLOG= N  
END DATA  
/\*

in structured mode DEFINE DATA  
1 #CONTROL-CARD (A72)  
1 REDEFINE #CONTROL-CARD  
2 #CC-PROGRAM(A8)  
2 #CC-CC (A2)  
2 #CC-FILL1 (A1)

1 #VALID-KEY-WORDS (A250)  
1 REDEFINE #VALID-KEY-WORDS  
2 #VALID-KEY-WORD(A10/1:#KMAX)  
\*  
END-DEFINE

- ------------------------------------------------------------ \*

- 

```
LIST ALL CONTROL CARD KEY_WORDS HERE                           

```

- ------------------------------------------------------------ \*  
MOVE ‘END DATA’ TO #VALID-KEY-WORD(01)  
MOVE ‘WORK FILE’ TO #VALID-KEY-WORD(02) /\* REQUIRED  
MOVE ‘EXE FILE’ TO #VALID-KEY-WORD(03)  
MOVE ‘TERMINATE’ TO #VALID-KEY-WORD(04) /\* OPT FAIL TERMINATE VALUE  
MOVE ‘DISPLAYLOG’ TO #VALID-KEY-WORD(05)

- ------------------------------------------------------------ \*

- 

```
PARSE THE CONTROL CARDS                                    

```

- ------------------------------------------------------------ \*  
FOR #C EQ 1 TO #CMAX  
INPUT #CONTROL-CARD

- 

IF #C EQ 1  
IF \*PROGRAM NE #CC-PROGRAM  
WRITE ‘INCORRECT CONTROL CARD’ / #CONTROL-CARD  
COMPUTE #BLOW-UP = #BLOW-UP / 0  
END-IF  
ESCAPE TOP  
END-IF  
\*  
RESET #CC-KEY-WORD #CC-VALUE #CC-REMAINDER  
SEPARATE #CONTROL-CARD INTO #CC-KEY-WORD #CC-VALUE  
REMAINDER #CC-REMAINDER WITH DELIMITER #CC-DELIMITER  
MOVE LEFT #CC-KEY-WORD TO #CC-KEY-WORD  
MOVE LEFT #CC-VALUE TO #CC-VALUE  
\*  
…

- ------------------------------------------------------------ \*
- HANDLE ALL CONTROL CARD KEYWORDS IN THIS DECIDE STATEMENT
- ------------------------------------------------------------ \*  
DECIDE ON FIRST VALUE #CC-KEY-WORD  
VALUE ‘END DATA’  
ESCAPE BOTTOM  
VALUE ‘DISPLAYLOG’  
MOVE #CC-VALUE TO #CC-I-DISPLAY-LOG  
VALUE ‘WORK FILE’  
MOVE #CC-VALUE TO #CC-I-WORKFILE  
VALUE ‘EXE FILE’  
MOVE #CC-VALUE TO #CC-I-EXE-FILE  
VALUE ‘TERMINATE’  
MOVE #CC-VALUE TO #CC-TERMINATE-CODE-A2 /\* OPT TERMINATE VALUE  
NONE  
WRITE 'USE AT MOST ’ #CMAX (EM=ZZ9) ‘CONTROL CARDS.’  
WRITE 'CTRL KEYS USE AT MOST 10 BYTES FOLLOWED BY AN EQUAL SIGN  
WRITE ‘END CONTROL CARD WITH STATEMENT:’ ‘END-DATA’  
WRITE ‘THE PROGRAM IS HAVING TROUBLE W/ CTRL KEY:’ #CC-KEY-WORD  
WRITE #CONTROL-CARD  
COMPUTE #BLOW-UP = #BLOW-UP / 0  
END-DECIDE

END-FOR

---

<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:51pm UTC](https://techcommunity.softwareag.com/t/how-to-pass-the-data-to-natural-program-through-jcl/80144/5 "2021-04-02T14:51:29Z")

</div>


