Topic
  • 3 replies
  • Latest Post - ‏2014-06-11T15:53:31Z by JonParis
Damery
Damery
71 Posts

Pinned topic Free-form exported procedure syntax

‏2014-06-11T14:42:18Z |

Does anyone have an example of coding an exported procedure in the 7.1 version of free-form?

I am writing a service program and want to write a free-form exported procedure.

I have tried this in my RDI 9.0.1 and am getting errors and no help...

dcl-proc myProcedureName export;

dcl-pi ind;

   myParmIn Char(10);

end-pi;

///code here

end-proc;

the above is just throwing errors ("ProcedureBegin" expected instead of this input).

  • JonParis
    JonParis
    154 Posts

    Re: Free-form exported procedure syntax

    ‏2014-06-11T15:06:15Z  

    You can omit the name on the pi if you choose - BUT - you must use the placeholder *N in that case. The compiler expects the name to be the first thing after the dcl. In the D-spec days that name was in a fixed position so it was easy to detect if it was omitted. Not so with free-form - you must tell it. So either of these  will work:

    dcl-pi myProcedureName ind;

    or

    dcl-pi *N ind;

     

    The same applies on unnamed DS in order for it to know that the keywords that follow are not the DS name.

     
    Updated on 2014-06-11T15:07:46Z at 2014-06-11T15:07:46Z by JonParis
  • Damery
    Damery
    71 Posts

    Re: Free-form exported procedure syntax

    ‏2014-06-11T15:33:32Z  
    • JonParis
    • ‏2014-06-11T15:06:15Z

    You can omit the name on the pi if you choose - BUT - you must use the placeholder *N in that case. The compiler expects the name to be the first thing after the dcl. In the D-spec days that name was in a fixed position so it was easy to detect if it was omitted. Not so with free-form - you must tell it. So either of these  will work:

    dcl-pi myProcedureName ind;

    or

    dcl-pi *N ind;

     

    The same applies on unnamed DS in order for it to know that the keywords that follow are not the DS name.

     

    You are correct I should have cut and pasted my example instead of typing.

           dcl-proc myExportedProcedure EXPORT;
           dcl-pi *n ind;
             myInputDataStructure LikeDs(myDataStructure);
           End-pi;       

    But this still doesn't compile and is throwing that same error 

    "ProcedureBegin" expected instead of this input.

    OK update! This is compiling but shows an error in RDi. thanks anyway.

    Updated on 2014-06-11T15:34:53Z at 2014-06-11T15:34:53Z by Damery
  • JonParis
    JonParis
    154 Posts

    Re: Free-form exported procedure syntax

    ‏2014-06-11T15:53:31Z  
    • Damery
    • ‏2014-06-11T15:33:32Z

    You are correct I should have cut and pasted my example instead of typing.

           dcl-proc myExportedProcedure EXPORT;
           dcl-pi *n ind;
             myInputDataStructure LikeDs(myDataStructure);
           End-pi;       

    But this still doesn't compile and is throwing that same error 

    "ProcedureBegin" expected instead of this input.

    OK update! This is compiling but shows an error in RDi. thanks anyway.

    It certainly works for me and shows no error in my version of RDi 9.0.1. You sure you are using that version with the free form updates?