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

which cl command can be used at program execution to redirect the file named in an rpg program?

710


how you will know whether you are in sfldrop or sflfold mode?

631


what is match field indicator?

1023


How to convert a spool file to PDF file in AS400?

737


What is access path in as400?

849






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...

1917


what is sflinz and sflrna?

1017


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

572


what is the maximum number of files allowed in rpg?

942


difference between view and index ?

713


what is the sequence when using cursor?

605


is it possible to create a physical file without dds?

1196


What is data structure in as400? What is the use of data structure?

604


if we tried to move year part of *iso date into a field of length 3, what will happen ?

654


how to read database records without locking them?

1143