CAN WE READ RECORDS WITHOUT USING SETLL,READ,CHAIN IN RPG?
Answers were Sorted based on User's Feedback
Answer / mathan kumar
It is Possible by Declare the pf file as a primary file
then you can access the records from pf by using the pf
fields in the program....
Is This Answer Correct ? | 26 Yes | 3 No |
Answer / rosh
above both answers are correct,as well if you use the flat
file and define this flat file as peogram decribe file and
define pre - run time array with file, so when program get
active, records will derectly comes to array.
Is This Answer Correct ? | 4 Yes | 0 No |
Answer / baratiya
File information DS can be used for this purpose as well.
Ffile1 IF E INFDS(fileinfo)
Dfileinfo DS
rcds *Records
Is This Answer Correct ? | 2 Yes | 1 No |
Hi Sai,
We can read records in so many ways in RPG Program.
1) primary file as file designation
2) file information data structure
3) Using pre-run-time array
0001.00 FFLAT01 IT F 5 DISK
0002.00 DPRE_ARR S 5 DIM(5) FROMFILE(FLAT01)PERRCD(1)
0003.00 C PRE_ARR(1) DSPLY
0004.00 C PRE_ARR(2) DSPLY
0005.00 C PRE_ARR(3) DSPLY
0006.00 C PRE_ARR(4) DSPLY
0007.00 C PRE_ARR(5) DSPLY
0008.00 C SETON LR
OUTPUT :
-----------
AAAAA
BBBBB
CCCCC
DDDDD
EEEEE
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / sai829
H Rosh,
CAN YOU PLEASE Elaborate your answer.i.e how to Define pre - run time array with file in RPG?...Thanks in Advance.
Is This Answer Correct ? | 0 Yes | 0 No |
I am reading a file in CL program. and MONMSG CPF0864 has arrived means EOF has arrived. Now i want to read this file again. How i can do this?
5 Answers CitiGroup, Symphony,
HOW TO DELETE THE RECORD FROM MASTER FILE WHICH IS LINK BY ANOTHER TRASATION FILE WITH REFERTIAL INTYGRITY?
1.find most occurrences of a character. for exm: input:aaabbbbdddddyyy output: d 5 times how can i get that?
can anyone explain aboutovrOVRDBF,OPNQRYF, OVRSCOPE and OPNSCOPE?
1.The questions have given an array declaration and move operation then this statement is correct or not?
Please tell me how to read the records from a file with load an array of size with error conditions(The logic answer for this question is ARR is array of 99 elements Z-ADD 0 IDX *LOVAL SETLL FILE READ FILE 99 *IN99 DOWEQ *OFF IDX ANDLT 99 ADD 1 IDX MOVE FIELD ARR,IDX READ FILE 99 ENDDO).So,Please give me the complete of this code.
How can we access Interactive job LDA in Batch Job?. and How we can access a file in interactive QTEMP lib in Batch job?.
i)What is the command to lock a file in a program ii)2. Can you get a level check error in a CL program
In case if I want to know whether a record exists in a file, which one do you prefer CHAIN or a SETLL and why ?
Write a program to display prime numbers between 1 to 100 using RPGLE.
in a cl pgm records are copied to a file in qtemp a pgm is called to delete records from the file in qtemp no of records in file in library qtemp is checked wat shud be the count of records let say it was 10 initially endpgm
i would like to know under what circumstance the object will get locked on AS400.