# Natural batchmode CMOBJIN

**URL:** <https://techcommunity.softwareag.com/t/natural-batchmode-cmobjin/97217>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-on-Linux\
**Created:** [May 25, 2011, 1:25pm UTC](https://techcommunity.softwareag.com/t/natural-batchmode-cmobjin/97217 "2011-05-25T13:25:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tony\_Y](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/tony_y/32/121_2.png) [@Tony\_Y](https://techcommunity.softwareag.com/u/Tony_Y)\
**Post date:** [May 25, 2011, 1:25pm UTC](https://techcommunity.softwareag.com/t/natural-batchmode-cmobjin/97217/1 "2011-05-25T13:25:22Z")

</div>

Hi,

I am running batch to simulate a Natural online function. Now, I come to a screen which requires a single character input and then press function key [F8]. [ENTER] key is not accepted due to the rule set in the MAP.

I tried to simulate these keystokes in several ways but failed. In the CMOBJIN.txt, I have tried:

3  
%K8

or

3 %  
%K8

or

3,  
%K8

Can someone provide me hint ? Sample screen attached.

Regards.  
[sample.doc](https://techcommunity.softwareag.com/uploads/short-url/uZ2fRqDu3aAOVyDPjAdXz0GAtMX.doc) (59 KB)

---

<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:** [May 25, 2011, 2:18pm UTC](https://techcommunity.softwareag.com/t/natural-batchmode-cmobjin/97217/2 "2011-05-25T14:18:45Z")

</div>

Hi Tony,

How’s things?

I initially thought the problem might be related to the fact that there is only a one character input field on the map. True on mainframe but I was forgetting this was open systems and a % causes a pop-up window for input.

I wrote a Q&D map & program to test a few theories out. The map had a single A1 input field and the program is below.

```auto
0010 SET KEY PF8
0020 INPUT USING MAP 'M1' #A(A1)
0030 WRITE #A *PF-KEY
0040 END
```

It looks like the % gets in the way of processing the input field on the map. If you enter ‘X’ in #a and press the PF8 button it displays ‘X PF8’ but if you enter ‘X’ and type %K8, it displays ’ PF8’ with #A being null.

Can you change the program (or map processing rule) to check for \*DEVICE?

Cheers,

Graeme Lane  
graeme.lane@immi.gov.au

---

<div class="post-metadata">

**Author:** ![Tony\_Y](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/tony_y/32/121_2.png) [@Tony\_Y](https://techcommunity.softwareag.com/u/Tony_Y)\
**Post date:** [May 25, 2011, 3:29pm UTC](https://techcommunity.softwareag.com/t/natural-batchmode-cmobjin/97217/3 "2011-05-25T15:29:41Z")

</div>

Hi Graeme,

How are you? Nice to meet u here.

In my batch job, I can never pass PF8 to the screen. It always treat it as [ENTER]. Using your example, the output is:

NEXT LOGON TEST  
Logon accepted to library TEST.  
NEXT EXECUTE FX

field1\_\_\_

DATA a  
Page 1 11-05-25 16:37:43

a ENTR  
NEXT FIN  
NAT9995 Natural session terminated normally.

I could not probably ask customer to change the program. Btw, what do you mean by checking \*DEVICE ?

Best Regards.

---

<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 26, 2011, 1:33pm UTC](https://techcommunity.softwareag.com/t/natural-batchmode-cmobjin/97217/4 "2011-05-26T13:33:17Z")

</div>

> [@Tony Y.](#):
>
> Btw, what do you mean by checking \*DEVICE ?

Just a wild guess:

```auto
if *DEVICE = 'BATCH'
  ... fill the mask-fields ...
else
  INPUT using map
end-if
```

You can use \*SCREEN-IO as well.

---

<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:00pm UTC](https://techcommunity.softwareag.com/t/natural-batchmode-cmobjin/97217/5 "2021-04-02T15:00:18Z")

</div>


