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

what is decimal data error? when it will come and how to achieve(rectify) this error please give me solution as well as code

2 Answers   IBM,


why we do STRSRVJOB in batch debugging in as400

1 Answers  


Can you copy the records created by the OPNQRYF to other files and how?

2 Answers  


How can we search particular records from the database file in RPG. For example, there are 100 records in the file.i need to retrieve all the records matching/equal to the particular 'NAME' field. How can we do the above using SEARCH criteria other than using the IF cond?

4 Answers   CTS,


how to check on which PF , the LF is dependant ?

4 Answers   IBM,






how to find whether a date format is valid or not in RPG400 not in RPGILE.Can you please write the coding for this sir,i'm new to AS400.Please help.

1 Answers  


Mr.Yallamanda Reddy P thanks for your answer sir,can we use test(D) opcode in RPG/400,if yes please help me by eloborating on that answer by writing a sample code for that sir

2 Answers   iGate,


Q:HI friends accually ihave one problem plesase let me know the alternate code of this code. Related field description of code: Add a field, CALvsPRD, "Calendar Day Starts Before/After Production Day" to the parameter set WRKORDER which accepts values 'A' or 'B' o B = Calendar Day Starts Before Production Day o A = Calendar Day Starts After Production Day o Any other value indicates the production and calendar dates are always the same. code: Automatic Execution Of *INZSR Subroutine /Z01 * retrieves WRKORDER field values. /Z01 * Calculate default Production Date and return it to caller. /Z01 * Production date defaults to system date /Z01 C Eval P@Pdate = %DATE() /Z01 * unless Calendar date starts Before PDN(production) date and /Z01 * system time is before PDN Start Time then /Z01 * PDN date is yesterday. /Z01 C If W@CALvsPRD = 'B' and /Z01 C %TIME() < %TIME (W@Strtime) /Z01 C Eval P@Pdate -= %Day(1) /Z01 * unless Calendar date starts After PDN date and /Z01 * system time is *GE PDN(production) Start Time then /Z01 * PDN date is tomorrow. /Z01 C ElseIf W@CALvsPRD = 'A' and W@Strtime > *Zero and /Z01 C %TIME() >= %TIME (W@STrtime) /Z01 C Eval P@Pdate += %Day(1) /Z01 C EndIf /Z01 C Eval *InLr = *On

0 Answers   IBM,


I need to generate outfile for object of all the user lib. in the sysmte using cmd DSPOBJD. But this cmd is correcpted in my server,Any body tell me is there any alternative...?

2 Answers  


The RP program is displaying records 11 times .But there are 10 records in a pf.(ie last record is displayed twice).How to display records only 10 times?

5 Answers  


How can we override a file during runtime in RPG? Without using OVRDBF or calling a CL program

1 Answers   UST,


1.WHAT IS WRONG WITH THE CODE BELOW? C CUSTNO CHAIN CUSTMAST IF %ERROR can any body find the wrong please? 2.What builtin function will you use to achieve the following functionality? C QTY IFLT *ZERO C QTY MULT-1 QTY ENDIF

5 Answers   CTS,


Categories