How to read 2 positions at a time in a data area? I have
created a data area of length and i have to read the values
of the data area like 91-92,93-94 at a time up till 100

Answer Posted / chandrababu

Please see below code

Ex TESTDTA value: ABCDEFGHIJKL

0001.00 PGM
0002.00 DCL VAR(&AB) TYPE(*CHAR) LEN(2)
0002.01 DCL VAR(&I) TYPE(*DEC) LEN(2) VALUE(1)
0003.00 READ: IF COND(&I *LE 24) THEN(DO)
0004.00 RTVDTAARA DTAARA(DURGA4001/TESTDTA (&I 2)) RTNVAR(&AB)
0004.01 CHGVAR VAR(&I) VALUE(&I +2)
0004.02 IF COND(&AB *NE ' ') THEN(DO)
0004.03 SNDUSRMSG MSG(&AB)
0004.04 ENDDO
0004.05 ELSE CMD(GOTO CMDLBL(END))
0006.00 GOTO READ
0007.00 ENDDO
0008.00 END:
0009.00 ENDPGM

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is binder language ?

1362


The content of Physical file is as below: hfcftp wruquief SENDPASV 0 CDUP ASCII GET 01100901.CSV ramndk/ECP505.EC0110090 (REPLACE QUIT Thw above commands will get executed when we call STRTCPFTP from CL program.... Now if I want to use SFTP what can be the solution? plz reply in detail....Thank you for ny help... I m using RPG/ILERPG to download...

1915


how do handle file exception/error?

648


when are the referential constraints executed?

632


which of the cl command can be used to determine which logical files are dependent on a specific file?

593






when is a tag statement used in rpg?

1361


1. There is a file called Month. Month has 12 members called Jan, Feb, ..., Dec. How to design a rpg code which can access any member and show its content. (User can ask for any member when required)?

405


different type of cursor?

638


Write a logic program for knowing the repeated number of a vowels in a given program?

3309


what is rpg ?

940


describe the difference between the dowxx and douxx operations?

1166


what is the purpose of putovr (put with explicit override) keyword?

930


what is the purpose of ovrdta and ovrata keywords ?

886


How can we read file using curser? how to define a curser?

827


what are the different types of arrays available in rpg ?

961