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 / puneet7jun

You can achieve the above by a CL Program. I'm writing a
sample program which is reading DATA AREA 'TESTDTA' of
length 6.
PGM
DCL VAR(&A) TYPE(*CHAR) STG(*AUTO) LEN(1)
DCL VAR(&B) TYPE(*CHAR) STG(*AUTO) LEN(1)
DCL VAR(&C) TYPE(*CHAR) STG(*AUTO) LEN(1)
DCL VAR(&D) TYPE(*CHAR) STG(*AUTO) LEN(1)
DCL VAR(&E) TYPE(*CHAR) STG(*AUTO) LEN(1)
DCL VAR(&F) TYPE(*CHAR) STG(*AUTO) LEN(1)
RTVDTAARA DTAARA(ICIWRKPUS/TESTDTA (1 1)) RTNVAR(&A)
RTVDTAARA DTAARA(ICIWRKPUS/TESTDTA (2 1)) RTNVAR(&B)
RTVDTAARA DTAARA(ICIWRKPUS/TESTDTA (3 1)) RTNVAR(&C)
RTVDTAARA DTAARA(ICIWRKPUS/TESTDTA (4 1)) RTNVAR(&D)
RTVDTAARA DTAARA(ICIWRKPUS/TESTDTA (5 1)) RTNVAR(&E)
RTVDTAARA DTAARA(ICIWRKPUS/TESTDTA (6 1)) RTNVAR(&F)
SNDUSRMSG MSG(&A)
SNDUSRMSG MSG(&B)
SNDUSRMSG MSG(&C)
SNDUSRMSG MSG(&D)
SNDUSRMSG MSG(&E)
SNDUSRMSG MSG(&F)
ENDPGM

Is This Answer Correct ?    3 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how can a cgi check whether an ifs object is available?

643


define what a data queue is along with a brief example of what it may be used for?

1074


Why we sometimes use same file name in file and tofile in ovrdbf and sometimes different?

661


What is compiler directive in as400? Give example of compiler directive.?

576


what is the use of dspatr(mdt) keyword?

1452






How Many Specs Are There In Rpg & Which Are They?

686


what would be the effect on the field where reverse image, underline and highlight display attributes are active ?

1001


difference between sflrcdnbr and sflnxtchg?

705


define a output queue?

941


how many files can be defined in f specs?

1416


what are different types of substems?

1345


what does dfu program you to do on a record?

738


what is the clp command to access a query/400?

1364


what is the function of cpysplf command?

982


writing an sql statement from selecting records from two files using single statement and nested select statement.

643