Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
2 replies Latest Post - ‏2013-11-21T14:14:50Z by Jorge Nagasaki
Jorge Nagasaki
Jorge Nagasaki
2 Posts
ACCEPTED ANSWER

Pinned topic RDz Custom Code Review - Call stmt

‏2013-10-16T18:22:07Z |

Hi,  I am trying to create a custom rule in Code Review function of RDz.   I am able to run some samples, and simple custom rules, and Now I have a specific need in our tests.    I need to check the name of the program that is in the  Call statement in cobol source. Or the name of the variable..  I tried to find someway in the CallStmt object to get this information , but I was not able to find a way to get the called program .   Do you have any idea how to accomplish this?   tks

  • AdamBritt
    AdamBritt
    1 Post
    ACCEPTED ANSWER

    Re: RDz Custom Code Review - Call stmt

    ‏2013-11-19T16:12:04Z  in response to Jorge Nagasaki

    You may have figured it out already, but since I was working with the CallStmt earlier today the answer is easy for me.

     

    The interface CallStmt has a method "getProgram" which gets the program name. The return type of this function is DataRefOrLiteral, which is an umbrella type that is either a DataRef (variables and a bunch of other stuff) or a literal (hard coded value). You then need to go further down the type hierarchy, depending on which type in order to get the actual value.