# User ID in batch

**URL:** <https://techcommunity.softwareag.com/t/user-id-in-batch/197828>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-on-Mainframes\
**Created:** [January 18, 2018, 10:01pm UTC](https://techcommunity.softwareag.com/t/user-id-in-batch/197828 "2018-01-18T22:01:31Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dumisani\_Mkhize1](https://avatars.discourse-cdn.com/v4/letter/d/d6d6ee/32.png) [@Dumisani\_Mkhize1](https://techcommunity.softwareag.com/u/Dumisani_Mkhize1)\
**Post date:** [January 18, 2018, 10:01pm UTC](https://techcommunity.softwareag.com/t/user-id-in-batch/197828/1 "2018-01-18T22:01:31Z")

</div>

I am trying to retrieve the user-id of the person who submitted a job. In my Natural program I use \*USER, but it returns the JOBNAME and not the user-id of the person who submitted the job.

How can I get the program to return the user-id?

Thanks?  
DM

---

<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:** [January 19, 2018, 5:25pm UTC](https://techcommunity.softwareag.com/t/user-id-in-batch/197828/2 "2018-01-19T17:25:38Z")

</div>

Take a look in the Parameters Reference document, OSP parameter, USERID subparameter. You should be able to get the user ID in the \*INIT-USER system variable.

---

<div class="post-metadata">

**Author:** ![Dumisani\_Mkhize1](https://avatars.discourse-cdn.com/v4/letter/d/d6d6ee/32.png) [@Dumisani\_Mkhize1](https://techcommunity.softwareag.com/u/Dumisani_Mkhize1)\
**Post date:** [January 19, 2018, 6:24pm UTC](https://techcommunity.softwareag.com/t/user-id-in-batch/197828/3 "2018-01-19T18:24:01Z")

</div>

Thanks, but the \*INIT-USER and \*NET-USER also return the Jobname. It seems our administrator changed some of the parameters (somewhere) so that \*USER, \*NET-USER, \*INIT-USER (and maybe others as well) return a Jobname instead of the user-id of the person who submitted the job.

---

<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:** [January 19, 2018, 6:51pm UTC](https://techcommunity.softwareag.com/t/user-id-in-batch/197828/4 "2018-01-19T18:51:03Z")

</div>

The content of \*INIT-USER depends on the setting of the OSP parameter (or NTOSP macro).

The default OSP=(USERID=OFF) gives you the job name.

OSP=(USERID=ON) gives you the user ID.

---

<div class="post-metadata">

**Author:** ![Dumisani\_Mkhize1](https://avatars.discourse-cdn.com/v4/letter/d/d6d6ee/32.png) [@Dumisani\_Mkhize1](https://techcommunity.softwareag.com/u/Dumisani_Mkhize1)\
**Post date:** [January 19, 2018, 7:21pm UTC](https://techcommunity.softwareag.com/t/user-id-in-batch/197828/5 "2018-01-19T19:21:14Z")

</div>

Where do I change this parameter value? (How do I do it?)

Thanks again

---

<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:** [January 19, 2018, 7:56pm UTC](https://techcommunity.softwareag.com/t/user-id-in-batch/197828/6 "2018-01-19T19:56:40Z")

</div>

This will depend on your Natural Security settings and how your Natural PROC is constructed.

```auto
//NATURAL EXEC NATBT,PARM='AUTO=OFF,OSP=(USERID=ON)'
//CMPRINT DD SYSOUT=*
//CMSYNIN DD *
library,userid,password
pgm-name
FIN
/*
//
```

---

<div class="post-metadata">

**Author:** ![Dumisani\_Mkhize1](https://avatars.discourse-cdn.com/v4/letter/d/d6d6ee/32.png) [@Dumisani\_Mkhize1](https://techcommunity.softwareag.com/u/Dumisani_Mkhize1)\
**Post date:** [January 19, 2018, 9:16pm UTC](https://techcommunity.softwareag.com/t/user-id-in-batch/197828/7 "2018-01-19T21:16:02Z")

</div>

I thank you so very very much.

DM

---

<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:39pm UTC](https://techcommunity.softwareag.com/t/user-id-in-batch/197828/8 "2021-04-02T15:39:59Z")

</div>


