# using INPUT in a batch mode

**URL:** <https://techcommunity.softwareag.com/t/using-input-in-a-batch-mode/101060>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-on-Mainframes\
**Created:** [July 24, 2012, 9:44am UTC](https://techcommunity.softwareag.com/t/using-input-in-a-batch-mode/101060 "2012-07-24T09:44:01Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hezi](https://avatars.discourse-cdn.com/v4/letter/h/a5b964/32.png) [@Hezi](https://techcommunity.softwareag.com/u/Hezi)\
**Post date:** [July 24, 2012, 9:44am UTC](https://techcommunity.softwareag.com/t/using-input-in-a-batch-mode/101060/1 "2012-07-24T09:44:01Z")

</div>

Hi,

I want to read some data from a jcl using Input command.  
The line looks like: abc11111111111111111,123,20120724,user,vse

As the program start I perform Input command : input #a #b #c #d #e. (size for each value #a=a29,#b=a8,#c=a6,#d=a4,#e=a8)  
But I get only the 2 paramaters.

Hezi

---

<div class="post-metadata">

**Author:** ![Finn\_the\_Dane1](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/finn_the_dane1/32/132_2.png) [@Finn\_the\_Dane1](https://techcommunity.softwareag.com/u/Finn_the_Dane1)\
**Post date:** [July 24, 2012, 11:06am UTC](https://techcommunity.softwareag.com/t/using-input-in-a-batch-mode/101060/2 "2012-07-24T11:06:48Z")

</div>

What is your input delimiter (ID) ?  
If it is anything other than “,” getting only two parms makes absolute sense 😉  
Finn

---

<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:** [July 24, 2012, 4:10pm UTC](https://techcommunity.softwareag.com/t/using-input-in-a-batch-mode/101060/3 "2012-07-24T16:10:53Z")

</div>

According to the documentation for INPUT:

> [@](#):
>
> The INPUT statement may be used in screen, forms, or keyword/delimiter mode. Screen mode is generally used with video terminals/screens. Forms mode may be used with TTY terminals. Delimiter mode is used with TTY terminals, and also in batch mode (on mainframe computers). The default mode is screen mode.
> 
> You can change the input mode with the session parameter IM or the terminal commands %F and %D.

I have never used delimited mode. What I would do is this:

```auto
define data local
1 #input (a78)
1 #a (a29) 
...
end-define
input #input
separate #input into #a #b #c #d #e with delimiter ',' ignore
...
```

---

<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:** [July 24, 2012, 7:02pm UTC](https://techcommunity.softwareag.com/t/using-input-in-a-batch-mode/101060/4 "2012-07-24T19:02:35Z")

</div>

When I define all fields (#a to #e) as a29 it works no matter how I change the parameters (IM, ID, DC, …)

I changed the input to

```auto
separate #input into #a #b #c #d #e ignore with delimiter ',' number #num
```

and #num is 5 in all cases.

However, when I change the definitions to match what you said

```auto
#a=a29,#b=a8,#c=a6,#d=a4,#e=a8
```

I get a NAT1314 (target field too small) which is to be expected as the 3rd part of your input is 7 digits  
but you separate it into an a6.

Same result on the mainframe and Windows, so your example can hardly match your actual code.

---

<div class="post-metadata">

**Author:** ![Hezi](https://avatars.discourse-cdn.com/v4/letter/h/a5b964/32.png) [@Hezi](https://techcommunity.softwareag.com/u/Hezi)\
**Post date:** [July 26, 2012, 6:58am UTC](https://techcommunity.softwareag.com/t/using-input-in-a-batch-mode/101060/5 "2012-07-26T06:58:26Z")

</div>

Hi,

You are all probaly right.  
I get that jcl from an open system, and there was no IM= defition.

Hezi

---

<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:02pm UTC](https://techcommunity.softwareag.com/t/using-input-in-a-batch-mode/101060/6 "2021-04-02T15:02:13Z")

</div>


