Release 10.1A: OpenEdge Development:
ProDataSets

> ## Passing a ProDataSet parameter by binding

> You can also save the overhead of copying a ProDataSet’s definition and data on a local call by using the `BIND` keyword. Passing a ProDataSet to a local routine using the `BIND` keyword allows the calling routine and the called routine to access the same ProDataSet instance by:

> - Binding a reference-only static ProDataSet defined in one routine to a ProDataSet instance defined in another routine.

> - Binding an unknown `DATASET-HANDLE` parameter defined in one routine to a ProDataSet instance defined in another routine.

> In the static case, you must define a reference-only ProDataSet in either the calling routine or the called routine by specifying the `REFERENCE-ONLY` keyword in the `DEFINE` statement for the ProDataSet.

> You use the `BIND` keyword in both the calling and called routines to tell Progress to bind both ProDataSet references to the same ProDataSet instance. In the calling routine, you add the keyword to the parameter in the `RUN` statement, as shown:

>     RUN internal-procedure-name IN procedure-handle
>         ( [ INPUT | INPUT-OUTPUT | OUTPUT ] DATASET dataset-name BIND )

> In the called routine, you specify the keyword as part of the parameter definition:

>     DEFINE [ INPUT | OUTPUT | INPUT-OUTPUT] PARAMETER
>       DATASET FOR dataset-name BIND

> When you pass a ProDataSet parameter to a local routine using the `BIND` keyword, you can define a reference-only ProDataSet object in either the calling routine or the called routine. In either case, the reference-only object definition remains bound to the object instance until the routine containing the reference-only object definition is deleted or terminates.

> The most basic case where you would want to use the `BIND` keyword is when you want to use the called routine’s ProDataSet instance instead of the calling routine’s instance.

Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095