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 |
can i use UPDDTA command in rpg program in which contains a file
wat is curser?? and its types???
Q:Hi all,i want accurate answer with code using in built functions.please sent me code as soon as posible. I have program nmed PGM1 which '' RETRIEVE Current production date''should correctly default the production date for the user who is issuing raw materials to the manufacturing.The production date can be different from the celendra date. However, the program does not make the correct adjustment for all manufacturing plants. there is a parameter which determines the production start time e.g. 07:00 if the system time precedes this,the program subtracts one from the celendra day.This work fine when the celendar day starts after production day as it does in England,the system should be adding one to the celendar day during the overlap. unfortunately the program was desined to assumed the celendar day always starts before the production day. Change required in the program: Change the PROGRAM PGM1 to use the new parrameter to decide whether to add or subtract 1 from the celendar day when determining the production date.
what is mean by *MAP and *DROP?what commands use these two keywords?why are they used?
In ProgramB there is a SBMJOB, which is a call to program C .There is also a CALL to program D from B. How would you check the program C has been executed in D?
How do I read records from Subfile? what is the purpose of READC explain with example?
Given the following code, what is the value of RESULT? DName+++++++++++ETDsFrom+++To/L+++IDc.Keywords+++++++++++++ D RESULT S 5 0 C EVAL RESULT = (2 + 3 * 2) ** 2 / 2
Suppose I have 3 jobs a b and c. I want to submit b after successful completion of a and want to submit c after successful completion of b. Without using job scheduler or job queue, how can I do that through cl program?
how we retrieve records without using key field (ex:name) from Physical File through RPG in as/400?
How can a screen field that has changed since the last output operation be detected?
write an RPG program to calculate the marks of 5 students (A,B, C, D, E)in 3 different subjects (eng, math, sci) an display on the screen
Can we trigger an rpg program which has user interaction with display file when updating a file using the command ADDPFTRG?