Search code examples
ibm-midrangerpglerpgicebreak

Call procedure (long name) into variable (not free)


I'm trying to call a procedure and assign a variable with the output.

My problem is that my procedure name is to long for the allowed space:

This is my working source, is it posible to use move or movel and do the same?

c                   eval      pSitProp      = json_parseString(wSitProp)

...

  3774 c                   move      pSitProp      json_parseString(wSitProp)                            01 CA050            005000                                                                  
======>                                                          aaaaabbccddee                                                      
*RNF5038 20 a      005000  Field-Length entry is not valid; defaults to blanks.                                                     
*RNF5044 20 b      005000  Decimal-Positions entry is not blank or 0 - 63; defaults to                                              
                           0.                                                                                                       
*RNF5051 20 c      005000  Resulting-Indicator entry is not valid; defaults to blanks.                                              
*RNF5051 20 d      005000  Resulting-Indicator entry is not valid; defaults to blanks.                                              
*RNF5051 20 e      005000  Resulting-Indicator entry is not valid; defaults to blanks.                                              

Solution

  • No you can not use MOVE or MOVEL

    You've got a lot of extra space between the results variable and the procedure call that is not needed. Your code actually fits just fine in a single line.

     c                   eval      pSitProp = json_parseString(wSitProp)
    

    But let's pretend it doesn't.
    You need to read up on the RPGLE continuation rules

    Here's one way to break the line.

     c                   eval      pSitProp
     c                              = json_parseString(wSitProp)
    

    If need be you can break up long names using the ellipsis (...) like so:

     c                   eval      pSitProp = json_parseString(wSit...
     c                              Prop)  
    

    Having said that, the best choice is to simply use free format.

        pSitProp = json_parseString(wSitProp);