# Defining Parameter while using FETCH RETURN??

**URL:** <https://techcommunity.softwareag.com/t/defining-parameter-while-using-fetch-return/60857>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-on-Mainframes\
**Created:** [April 22, 2006, 11:07am UTC](https://techcommunity.softwareag.com/t/defining-parameter-while-using-fetch-return/60857 "2006-04-22T11:07:17Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![rahul\_mf](https://avatars.discourse-cdn.com/v4/letter/r/f08c70/32.png) [@rahul\_mf](https://techcommunity.softwareag.com/u/rahul_mf)\
**Post date:** [April 22, 2006, 11:07am UTC](https://techcommunity.softwareag.com/t/defining-parameter-while-using-fetch-return/60857/1 "2006-04-22T11:07:17Z")

</div>

Hi all,

I am writing a program(say P1) which is calling another program(say P2)  
by a FETCH RETURN statement. P1 is passing some parameters to P2, I defined those parameters in “Define data parameter” statement in P2 but it is giving error, I tried for PDA also but showing the same error .

So where should I define those parameters in P2 ??

Rahul

---

<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 22, 2006, 3:12pm UTC](https://techcommunity.softwareag.com/t/defining-parameter-while-using-fetch-return/60857/2 "2006-04-22T15:12:08Z")

</div>

All questions you are asking are easily answered by the documentation available through this forum, in this case [url][http://developer.softwareag.com/ets/docu/natural/Nat414mf/print/sm.pdf[/url]](http://developer.softwareag.com/ets/docu/natural/Nat414mf/print/sm.pdf%5B/url%5D)

[i]Passing Parameter Fields:

The FETCH statement may also be used to pass parameter fields to the invoked program. A parameter field may be defined with any format. The parameters are converted to a format suitable for a corresponding INPUT field. All parameters are placed on the top of the Natural stack.

The parameter fields can be read by the FETCHed program using an INPUT statement. The first INPUT statement will result in the insertion of all parameter field values into the fields specified in the INPUT statement. The INPUT statement must have the sign position specification (session parameter SG=ON) for parameter fields defined with numeric format, because each parameter field defined with numeric format in the FETCH statement will receive a sign position if its value is negative.

If more parameters are passed than are read by the next INPUT statement, the extra parameters are ignored. The number of parameters may be obtained with the Natural system variable \*DATA.[/i]

---

<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 22, 2006, 3:17pm UTC](https://techcommunity.softwareag.com/t/defining-parameter-while-using-fetch-return/60857/3 "2006-04-22T15:17:09Z")

</div>

[i]Parameter Data Area

A Natural programming object of the type parameter data area (PDA) is used to define the data elements that are passed as parameters to a subprogram, external subroutine or helproutine.

A PDA allows subprograms, external subroutines, helproutines and dialogs to use the same data element definitions (for example, identical field names and formats).

A subprogram is invoked with a CALLNAT statement. With the CALLNAT statement, parameters can be passed from the invoking object to the subprogram.

In the same way, parameters that are passed to an external subroutine via a PERFORM statement must be defined with a DEFINE DATA PARAMETER statement in the external subroutine.[/i]

---

<div class="post-metadata">

**Author:** ![rahul\_mf](https://avatars.discourse-cdn.com/v4/letter/r/f08c70/32.png) [@rahul\_mf](https://techcommunity.softwareag.com/u/rahul_mf)\
**Post date:** [April 22, 2006, 5:02pm UTC](https://techcommunity.softwareag.com/t/defining-parameter-while-using-fetch-return/60857/4 "2006-04-22T17:02:18Z")

</div>

Hi Wolfgang , I was not having that document , thanks for sending me the link. 🙂

Could you please tell me ( or send me a single link ) where I can find all the documentation available through this forum.

---

<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 22, 2006, 5:29pm UTC](https://techcommunity.softwareag.com/t/defining-parameter-while-using-fetch-return/60857/5 "2006-04-22T17:29:45Z")

</div>

> [@rahul\_mf](#):
>
> Hi Wolfgang , I was not having that document , thanks for sending me the link. 🙂

No worries 😉

> [@rahul\_mf](#):
>
> Could you please tell me ( or send me a single link ) where I can find all the documentation available through this forum.

There is a “Documentation” link at the top of this page, it links to the top-level pages for

Adabas Documentation: [http://developer.softwareag.com/ets/docu/ada\_docu.htm](http://developer.softwareag.com/ets/docu/ada_docu.htm)

Natural Documentation: [http://developer.softwareag.com/ets/docu/nat\_docu.htm](http://developer.softwareag.com/ets/docu/nat_docu.htm)

---

<div class="post-metadata">

**Author:** ![rahul\_mf](https://avatars.discourse-cdn.com/v4/letter/r/f08c70/32.png) [@rahul\_mf](https://techcommunity.softwareag.com/u/rahul_mf)\
**Post date:** [April 24, 2006, 9:02am UTC](https://techcommunity.softwareag.com/t/defining-parameter-while-using-fetch-return/60857/6 "2006-04-24T09:02:57Z")

</div>

Thanks Wolfgang.

---

<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:40pm UTC](https://techcommunity.softwareag.com/t/defining-parameter-while-using-fetch-return/60857/7 "2021-04-02T14:40:35Z")

</div>


