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 |
Need a sql query: retrieve all duplicate records in table?
Hi friends, Can you give the solution for the below mention simple code.and explain.what is output D CHR1 S 4A INZ('PEN') D CHR2 S 10A INZ('MYGET') D CHR3 S 8A INZ('GOOD') D CHR4 S 22A INZ C MOVEL CHR1 CHR4 C MOVE CHR2 CHR4 C EVAL CHR4=CHR3 C MOVE CHR1 CHR4
1)how to do date validation in rpg? 2)how to delete dUPLICATE RECORDS?
Anybody know the difference of primary file and full procedural file
what is the difference between do while and do until?
Why did we give STRSRVJOB while debugging batch program
WHERE DO WE USE COMIT KEYWORD IN AN RPG PROGRAM? YOU MADE SOME CHANGES TO DATABASE BUT YOU DON'T WANT TO SAVE THOSE CHANGES NOW? HOW DO YOU HANDLE THIS ONE?
How can i keyed a flat file in RPGLE
How do you proceed in case your active AS400 session has got disconnected suddenly, how can you get back to your session ? Is it possible??
I know whole thing ab't Arrays related to declaration..can anyone tell me what exactly use of array or anyone faced a situation where he found use of array must....
steps involved in debugging and types of debugging modes?
In RPG program one file using as a PRIMARY file while running program some of the records reading twice any body know why its happening