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

To read two digits from data area we co as below

TESTDTA data area value is ABCDEFGHIJKL

Program:
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

can you specify a display file to be used in the following modes input,output, or combined modes ?

944


can anybody give the interview questions list of RLU. plz mail me: dinesh_sati07@yahoo.com

2239


what is sflinz and sflrna?

1017


what is a program described file in rpg?

1056


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)?

407






What is diff between EVAL & MOVE?

973


how can you execute a command from within an rpg program without calling a clp program?

1203


what is a spool file?

676


what are the two record formats a subfile contain ?

1127


hi guys i am new for sqlrpgle, please suggest me good websites and theory and coding. plz plz its very urgent.

2131


what is the maximum number of record formats in dspf?

994


Why we are not able to perform insert delete and update operation in Join logical file?

936


What is file information data structure(infds) in as400?

973


how can I control from my cgis the cache of a remote browser?

679


when is a tag statement used in rpg?

1368