Defining Parameter while using FETCH RETURN??

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

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]

[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]

[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]

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

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

No worries :wink:

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

Natural Documentation: http://developer.softwareag.com/ets/docu/nat_docu.htm

Thanks Wolfgang.