I have some doubts on subfile-----------

-----I wrote a prog on subfile to display the records.

Every thing is clear but i defined a field
called "opt" as
input field in subfile record format

from that input field i wish to enter into new
screen called "EDIT"

which i created it as a separate RCD in display
file. i gave opt as 2 for edit just like in WRKMBRPDM screen
please telll me the code and
how can i code for it in RPG.

Answers were Sorted based on User's Feedback



I have some doubts on subfile----------- -----I wrote a prog on subfile to display the reco..

Answer / sachin


EQ
READC SFLRCD 90
*IN90 DOWEQ *OFF
OPT COMP 2 SR100
ENDDO

SR100 BEGSR (TO DISPLAY NEW RECORD FORMAT )
*IN12 DOWEQ *OFF
EXFMT RCD1
|
|
|
ENDDO

I TINHK ABOVE STUFF IS ENOUGH FOR U TO UNDERSTAND THE LOGIC


Is This Answer Correct ?    4 Yes 1 No

I have some doubts on subfile----------- -----I wrote a prog on subfile to display the reco..

Answer / abhishek kumar

Use CSRLOC keyword to select the particular record. Once u
get the record, do what ever u want to do (e.g edit, etc)

Is This Answer Correct ?    0 Yes 0 No

I have some doubts on subfile----------- -----I wrote a prog on subfile to display the reco..

Answer / guest

Asyou gave option edit, you have changed the existing
recore, so do,
Readc SFLRCD;
when option ='Edit'
move the diplay file fields to the database field.
Do chain on the basis of key to database file (to read and
lock record for update)
Update File rcdfmt;
Update SFLRCD;

Is This Answer Correct ?    0 Yes 2 No

Post New Answer

More RPG400 Interview Questions

How to update selected fields from pf without using update opcode. How to read all member in Rpg-3,without using any cl command?

8 Answers  


this is rpg3 code W0RTN IFEQ @CN,002 what is the means @CN,002

1 Answers  


Q1.How to read the Array? Q2.How to copy the content of one Array to another Array?

4 Answers   IBM,


What is the Record Address file. How can we use it in RPG program?

4 Answers  


what will happen two jobs have same name are submitted

5 Answers   CTS,






How can you determine the number of characters in a variable?

3 Answers  


One of the job in subsystem is in Running status,expected time to complete this job is 2 minutes. But from last 5 -10 minutes this job is still in running status....What are the possible reasons...and What are the actions i need to perform to check this...?

4 Answers  


3. Given the DOS Specification below and the following information: • Indicator 50 is off • No records have been written to the subfile What will be the result if the EXFMT operation code is performed on the record format CTLR? A R SUBFL A DESCRIP 101 6 1ODSPATR(UL) A DFT(’NOT FOUND’) A R CTLR SFLCTL(SUBFL) A N50 SFLDSP A SFLDSPCTL A SFLINZ A 67 SFIJEND A SFLSIZ(13) A SFLPAG(12) A ACCOUNTNO 100 S 10 a.) Only AccountNo will display b.) SUBFL will be initialized with 13 blank records c.) An I/O exception error will occur d.) The screen will display 12 records with ‘NOT FOUND’

4 Answers   IBM,


I have one cl program which calls two rpg programs named a & b. I am loading a run time array in Pgm A and the control comes back to cl pgm. i call pgmb and I want to read the runtime array in pgmb which was loaded in pgma. How it can be acheived. I should not use any intermediate file or dataarea to store the loaded values.

2 Answers  


If the last record of a file has been read, and the next operation on that file is a READ operation, what will be the values of the input fields for that file? A. They will be blank and/or zero. B. They will be null. C. They will equal the values of the first record in the file. D. They will equal the values of the last record read.

3 Answers  


Delete FileName at first statement in RPG.

1 Answers  


give an eg of ACQ-(ACQUIRE),BIT OFF,BIT ON,DEALLOC,DUMP,FEOD,FORCE,MHHZO,MHLZO,MHLLZO,MLHZO,REL,RESET,TESTZ,TESTB,TESTN----GIVE SMALL EXAMPLE TO THE OPCODES...TO UNDERSTAND FUNCTIONING...........

0 Answers   CTS,


Categories