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

how to change the length of the field in a physicalfile?

12 Answers  


Please help me, I have created window subfile,I have created Footer with same lengh and postion of window SFL. When I call the pgm, first is shows only Footer and then it shows subfile records.This time Footer is not showsing ..plz hel me how can i do it...? Sameple DDS and RPG: A R WIN1 SFL A*%%TS SD 20090130 165346 MUNSHIJ REL-V4R2M0 5769- PW1 A FLD001 1Y 0B 4 3EDTCDE (Z) A ATFILE R O 4 7REFFLD (QWHFDBAS/ATFILE LIB/LIBF- A ILE) A R WINCTL SFLCTL (WIN1) A*%%TS SD 20090202 123459 MUNSHIJ REL-V4R2M0 5769- PW1 A ALTNAME ('y') A SFLSIZ (0004) A SFLPAG (0004) A WINDOW (FOOTER) A ROLLUP (27) A ROLLDOWN (28) A CF12 (12 'Cancel') A 50 SFLDSP A N51 SFLDSPCTL A 51 SFLCLR A 1 2'Select Option,Press enter' A 2 3'1= Select' A R FOOTER A* A WINDOW(8 31 9 43) A 8 4'F12 = Cancel' A R DUMMY ASSUME A 24 10' ' in RPG: Dow *IN12 = *Off Write Footer Fxfmt WInCTL

2 Answers  


Setps to create .csv file on IFS folder in AS/400( V4R3)....?

3 Answers   TCS,


purpose of pannel group??/

2 Answers   CTS,


what is EXCEPT command in rpg and use

1 Answers   Active Brains,






What would be the effect on the field where reverse image, underline and high intensity?

7 Answers   IBM,


which MONMSG will give higher priority in CL program? I know MONMSG are of two types. Program Level Monmsg and Command Monmsg?

1 Answers  


Hi Viewers can any body explain me how to update and ahange the already existed data in physical file using subfile ? please explain me with the code if possible?

1 Answers  


How can we override a file during runtime in rpg?

0 Answers  


What will be your approach in going either for OPNQRYF or Logical files. Which one to go for?

2 Answers  


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.

0 Answers   TCS,


How can you determine the number of characters in a variable?

3 Answers  


Categories