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

Answers were Sorted based on User's Feedback



Hi friends, Can you give the solution for the below mention simple code.and explain.what is outpu..

Answer / vaibhav gupta

C MOVEL CHR1 CHR4
CHR4='PEN '
C MOVE CHR2 CHR4
CHR4='PEN MYGET '
C EVAL CHR4=CHR3
CHR4='GOOD '
C MOVE CHR1 CHR4
CHR4='GOOD PEN '

Is This Answer Correct ?    13 Yes 0 No

Hi friends, Can you give the solution for the below mention simple code.and explain.what is outpu..

Answer / rashmi

C MOVEL CHR1 CHR4
=> CHR4 = 'PEN '
C MOVE CHR2 CHR4
=> CHR4 = 'PEN MYGET'
C EVAL CHR4=CHR3
=> CHR4 = 'GOOD '
C MOVE CHR1 CHR4
=> CHR4 = 'GOOD PEN'

Is This Answer Correct ?    8 Yes 2 No

Hi friends, Can you give the solution for the below mention simple code.and explain.what is outpu..

Answer / 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

Hi friends, Can you give the solution for the below mention simple code.and explain.what is outpu..

Answer / vinit

good pen

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More RPG400 Interview Questions

I have two sessions S1 & S2 under this 3 jobs(say j1,j2,j3 under session S1) And 2 jobs(Say j4, j5 Under session S2)is running. How many QTEMP & how many LDA will create for the same.

9 Answers   IBM,


What will happen if we r using seton lr after return or vice versa.

5 Answers  


1. I have2 records in a PF. READ PF DO DSPLY EMPNO RETRN DSPLY EMPNO ENDDO What was the output 2. SETON LR vs RETURN 3. Primary File 4. How to delete a deleted spaces 5. How to read a PF in reverse order in CL 6. I have a object in Lib A, B and C. But it shows in D Lib..Why? 7.

4 Answers   HCL,


How can you delete records form a file in rpg without using "Delete" OPCODE?

7 Answers  


difference between 1:%found and %equal built function in detail with example .

6 Answers   Polaris,






What does Implicit Open means with respect to a file ? What about the Explicit Open?..what are the major differences between these two?

1 Answers   IBM,


Assume my file has 100 records and I want to see only first 10 records. Is this possible through lf?

1 Answers  


Can anybody tell me the setps to create .csv file in IFS folder on AS/400. I also need to know how I can send this .csv file to PC in xls sheet.....?

2 Answers  


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?

1 Answers  


Delete FileName at first statement in RPG.

1 Answers  


1)how to do date validation in rpg? 2)how to delete dUPLICATE RECORDS?

12 Answers   IBM, Opus,


how we retrieve records without using key field (ex:name) from Physical File through RPG in as/400?

8 Answers  


Categories