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
Pinned topic RDz Custom Code Review - Call stmt
AdamBritt 270006CND31 PostACCEPTED ANSWER
Re: RDz Custom Code Review - Call stmt2013-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.