How I can read and display three fields in the record
format DSPFM1 of the display file,while
one field(using in one file) is NAME which is Key field in
field reference file and another two fields are AGE and ROLL
NO are using another file.

Please send me coding part.

Answers were Sorted based on User's Feedback



How I can read and display three fields in the record format DSPFM1 of the display file,while on..

Answer / syam

Changes in above code.

FFILE1 IF E K DISK USROPN ->Reading pf1
FFILE2 IF E K DISK USROPN ->Reading pf2
FDSPF CF E WORKSTN USROPN ->dspy file

C OPEN FILE1
C OPEN FILE2
C OPEN DSPF
C NAME SETLL FILE1
C READ recd1 51
C *IN51 DOWEQ *OFF
C NAME CHAIN recd2 41
C N41 WRITE DSPFM1
C READ FILE1 51
C ENDDO
C CLOSE FILE1
C CLOSE FILE2
C CLOSE DSPF
C RETURN


1.File1 & File2 need NAME key field
2.In dsplay DSPFM1 need Name, Age and Roll filed.
Recd1 = record format of File1 , Recd2 = record format of
file2

Is This Answer Correct ?    3 Yes 1 No

How I can read and display three fields in the record format DSPFM1 of the display file,while on..

Answer / syam

I am Pasting Code.
FFILE1 IF E K DISK USROPN ->Reading pf
FDSPF CF E WORKSTN USROPN ->dspy file

C OPEN FILE1
C OPEN DSPF
C SETLL FILE1
C READ FILE1 51
C *IN51 DOWEQ *OFF
C WRITE DSPFM1
C READ FILE1 51
C ENDDO
C CLOSE FILE1
C CLOSE DSPF
C RETURN

it will show all the records from file undil file ends.
if you need ILE RPG Free fromat code pls post again your
request

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More IBM AS400 AllOther Interview Questions

can we creat a member logical file

3 Answers  


I had ruestion in one of the interview..... If 1 file has more than 1 member and i want to use the 2nd member in the RPG pgm (in RPG400),how can I use this.... I know the possible answers i.e. useing API 'QCMDEXE' or Before calling the pgm I can use OVRDBF for that member... but I dont' want to use both the tips in above scenarion. Does any body tell me how can i use this ....?

13 Answers   Mind Tree,


Hello friends, i am having 1 year experience in AS/400. Can any one send me the as400 interview questions to my email id:nagaraju20087@gmail.com

1 Answers  


how do you specify the number of records to roll in a subfile ?

2 Answers   IBM,


What is the use of Header Specification in RPG/400?

1 Answers  






what are the different methods to access seu?

0 Answers   IBM,


how many triggers can be associated with a file?

1 Answers   IBM,


does cl support arrays

1 Answers  


How to avoid using indicators in ile ?

0 Answers   IBM,


how can u check no of records in a file?

0 Answers   IBM,


How can I automate sftp commands(ls & get) in CL program.. If I want to write two scripts one for each command... can u plz tell where the script should be written? & what will be the content of each scripts?

1 Answers  


what is the use of unique keyword and what level it is defined?

1 Answers   IBM,


Categories