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


Please Help Members By Posting Answers For Below Questions

What is a record lock error?

1259


How can we know running job is batch or interactive?

647


When it is desirable to describe files Internally?

1182


what happens when sflsiz = sflpag? What are the advantages and disadvantages?

706


what is the procedure and explain about real time scenario.

1473






what is the difference between do while and do until?

697


explain sflclr, sflend, sfldlt, and sflcsrrrn?

882


How would display prime numbers using CL program?

5672


are there any useful c runtime apis that I can call from rpg iv?

696


Assume 2 users are using the same file and first user updates some record in the file. Will the 2nd user will be able to see the updated record or not?

511


Please tell me how to read the records from a file with load an array of size with error conditions(The logic answer for this question is ARR is array of 99 elements Z-ADD 0 IDX *LOVAL SETLL FILE READ FILE 99 *IN99 DOWEQ *OFF IDX ANDLT 99 ADD 1 IDX MOVE FIELD ARR,IDX READ FILE 99 ENDDO).So,Please give me the complete of this code.

2045


How to define data area in RPG program? In which scenario multi occurrence DS is use in AS400?

1557


What is the diff bw PF/LF Name and their Record format name? what is restriction in record format then file name?

2513


How to write record if no field or the field are different in physical file in rpgle ?

483


How to declare the pull button in AS/400..

1872