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
what is service program?
what is a physical file?
I need to insert a record in a file using STRSQL containing the some field values same as an already existing record in that file.I know to smple insert mentioning those values one by one.But is there any another query can be prepared for the same .Please share the query if known to you. Thanks in advance.
which of the cl command can be used to determine which logical files are dependent on a specific file?
Difference between NOPASS & OMIT?
when are the unique constraints executed?
What is compiler directive in as400? Give example of compiler directive.?
in conjunction with what other keyword must ovrdta and ovrata be used?
can error messages as a result of a comp, range or values keyword be overridden?
what is the purpose of overrides?
what does the ovrdbf command do?
where will control be passed after the execution of the *pssr subroutine if the factor2 of the endsr is blank ?
can anybody give the interview questions list of RLU. plz mail me: dinesh_sati07@yahoo.com
what are the different opcodes available in rpg for database access ?
How to avoid using indicators in ile ?