can any body correct the following code?
Following a procedure which returns the maximum of two
numbers.Correct the following code.
P GETMAX B
D GETMAX PI
D NUM1 35 0
D NUM2 45 0
C IF NUM1 > NUM2
C RETURN NUM1
C ELSE
C RETURN NUM2
C ENDIF
P GETMAX E
Answer / vijay
to send a return value, you have to defined the return variable in front of PI which actually contain the return value the code should be as follows
P GETMAX B
D GETMAX PI 45 0
D NUM1 35 0
D NUM2 45 0
D rtnfld 45 0
C IF NUM1 > NUM2
C Eval rtnfld = Num1
C ELSE
C Eval rtnfld = Num2
C ENDIF
C Return rntfld
P GETMAX E
| Is This Answer Correct ? | 7 Yes | 1 No |
during execution, an rpg/400 program automatically follows a sequence of operations for each record that is processed. The built-in program cycle includes the following logical steps.
what is the necessary command needed before OPNQRYF and why?
Explain mdt?
How to search particular records from the database file in rpg?
I need to generate outfile for object of all the user lib. in the sysmte using cmd DSPOBJD. But this cmd is correcpted in my server,Any body tell me is there any alternative...?
1.How can you search an entire source file for a particular field name? 2.How can you find the differences between two versions of the source for the same program? 3.What is a hidden field as it relates to a sub file? 4.How do you display a sub file that has no records in the sub file?
How to find d key field of a pf that doesn’t have source physical file?
can you debug ile rpg program using isdb?
what will happen two jobs have same name are submitted
what built in function can be used with SETLL.If you want to check whether the search argument is successful or not? Please give me answer with example?
what is flat file?
HOW TO DELETE THE RECORD FROM MASTER FILE WHICH IS LINK BY ANOTHER TRASATION FILE WITH REFERTIAL INTYGRITY?