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

Program to read marks of 10 students for 4 subjects and compute and display total marks and status of each student in rpg

0 Answers  


what will happen two jobs have same name are submitted

5 Answers   CTS,


How can we make use of SETLL operation in CL?

11 Answers  


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

2 Answers  


what is decimal data error? when it will come and how to achieve(rectify) this error please give me solution as well as code

2 Answers   IBM,






IN RLU what are the record level keyword is used?

5 Answers   iGate, TCS,


Suppose we have 10 records with same name and we are reading using READE,after 4 record i have to use CHAIN what is the output

3 Answers  


If record-format name in an externally-described file has already been defined as a file-name.how to solve this?

2 Answers   CTS,


RPG/400 number of Records present in a physical file using file information data structure FPF001 IP E DISK F KINFDS INFDS1 IINFDS1 DS I *RECORD RECORD Is this coding correct sir,i have given I P E that is I- input,P-primary file,E-externally described. Primary to use RPG logic cycle,is this the correct method because we have to find number of records present using file information data structure in RPG/400 without doing any input/output operations on the file and also without using DSPFD,SQL. If the above coding is correct means,when i compile the program it gets compiled,but if i call the program it does not return anything,i need number of records,please complete the coding sir.

1 Answers   IBM,


A rpg or clp command to find if the file field is defined as a character or numeric field.

1 Answers   IBM,


The RP program is displaying records 11 times .But there are 10 records in a pf.(ie last record is displayed twice).How to display records only 10 times?

5 Answers  


Can anybody tell me, does CL/400 handle LEVEL check while running the CL program....? plz share your experience...

4 Answers  


Categories