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
Answer Posted / gatla
PGM: *************** Beginning of data ***********************
DCHR1 S 4A INZ('PEN')
DCHR2 S 10A INZ('MYGET')
DCHR3 S 8A INZ('GOOD')
DCHR4 S 22A
C MOVEL CHR1 CHR4
C MOVEL CHR2 CHR4
C EVAL CHR4=CHR3
C MOVE CHR1 CHR4
C CHR1 DSPLY
C CHR2 DSPLY
C CHR3 DSPLY
C CHR4 DSPLY
C SETON
****************** End of data **************************
O/P:
DSPLY PEN
DSPLY MYGET
DSPLY GOOD
DSPLY GOOD PEN
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
how do I declare a table or array in rpg iv?
what was the robotech rpg?
How to define data area in RPG program? In which scenario multi occurrence DS is use in AS400?
what is the use of sflnxtchg?
When we have a file with Duplicate records and I want to read the unique record from the file. For example a file containing Emp Name as 'Ram' and there are 3 entries of it. So how to read a unique record from File?
When it is desirable to describe files Internally?
How can we override a file during runtime in rpg?
what are the key words you must use when using a subfile?
what is data area and how it is used in rpg program ?
Set on command is used for closed all opened files , initialize var and release resource , return cmd is used for return to calling program but my req. Is dnt close opened files and resource must released while doing transactions , how can i do this...?
If my rpg program has a date field, what extra care I have to take while compiling that rpg program? If the file is keyed and I have declared the file as well as key list properly in my program. Still am getting an error message like "chain/reade operation is not allowed" what may be the case?
how can I tell when to replace the array?
are there any useful c runtime apis that I can call from rpg iv?
Explain mdt?
what is the necessary keyword needed to scroll subfile records?