In single page subfile,if I select the mutiple options in 1
page and without pressing enter,I press rollup key
(pagedown).In such case how I can handle it in rpg becasue
in single page we have to handle it in pgm. It would be
helpful if any one answer with coding

Answers were Sorted based on User's Feedback



In single page subfile,if I select the mutiple options in 1 page and without pressing enter,I pres..

Answer / swetha p rao

We can handle this using physical file RRN value.When user
enters some options in the first page and takes a pagedown

Read the changes on the subfile using ReadC ie; read the
option entered for that record and save the physical file
RRN value for that record in a temporary file along with
option (You can get RRN value by declaring File information
data structure for that physical file)

When you load the records in the subroutine bfore writing
the values to subfile ,Chain the temporary file with RRN
value and if the RRn is present in the temporary file move
the corresponding option to the Subfile options.

Check this temporary file evrytime you load the records on
subfile and update this temporary file evry time there is a
chnage on the subfile options.

Clear the temporary file when the user confirms delete or
when user doesnt want to delete.

Is This Answer Correct ?    14 Yes 2 No

In single page subfile,if I select the mutiple options in 1 page and without pressing enter,I pres..

Answer / ashish kashliwal

We can handle this using arrays. When user
enters some options in the first page and takes a pagedown
then read the changes on the sub-file using READC. first
validate the option, if entered options are valid then in
first array store the fields value (through which we can
identify record as unique in sub-file) and in second array
store the option.

Whenever load the sub-file, then first check if subfile
record is in array (with lookup), then write option equal
to second array value and clear the array element. else
display blank option.

Whenever user press enter (suppose user choose one option
in page one and another option on page 3) then process
option through array.

Is This Answer Correct ?    8 Yes 1 No

In single page subfile,if I select the mutiple options in 1 page and without pressing enter,I pres..

Answer / sanjib

CEELOCT and CEEDATE are APIs that exist on the system.

You do not need to create them.

In essence, what the CL that I supplied does is:

1) Use the CEELOCT API to convert the current date to
lillian.
2) Then you add or subtract the number of days you need
from the lillian date.
3) Then you use CEEDATE to convert the new lillian date
back to the date format that you wish, in this case, I used
YYYYMMDD.

Current Local Time (CEELOCT), to convert a date to Julian
format. To create this
program, you must use the CRTBNDCL command alone or the
CRTCLMOD
command and the CRTPGM command together.
PGM
DCL &LILDATE *CHAR LEN(4)
DCL &PICTSTR *CHAR LEN(5) VALUE(YYDDD)
DCL &JULDATE *CHAR LEN(5)
DCL &SECONDS *CHAR 8 /* Seconds from CEELOCT */
DCL &GREG *CHAR 23 /* Gregorian date from CEELOCT */
/* */
CALLPRC PRC(CEELOCT) /* Get current date and time
*/ +
PARMS (&LILDATE) /* Date in Lilian format */ +
&SECONDS /* Seconds field will not
be used */
&GREG /* Gregorian field will
not be used */
*OMIT /* Omit feedback
parameter so exceptions +
are signalled
*/

CALLPRC PRC(CEEDATE) +
PARMS (&LILDATE) /* Today’s date */ +
&PICTSTR /* How to format */ +
&JULDATE /* Julian date */ +
*OMIT

ADDPGM LIB1/FILEX MBR(’MBR’ *CAT &JULDATE’)
ENDPGM

Is This Answer Correct ?    0 Yes 4 No

In single page subfile,if I select the mutiple options in 1 page and without pressing enter,I pres..

Answer / guest.

System will take care of it . You do not need to specify
anything for that. Until user does not press Enter key
ReadC won't detect any change record.

First build the file according to the Size/Page. On Page up
load it again . u do not need to worry about the option u
have entered on first page.

Is This Answer Correct ?    1 Yes 18 No

Post New Answer

More RPG400 Interview Questions

How can we make use of SETLL operation in CL?

11 Answers  


i have a file with the values 10, 20, 30, 40, if am setll with the value 25 then readp, so what it will return?

6 Answers   Mind Tree,


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

1 Answers  


what r drawbacks of OPM? Why do we go for ILE RPG?

1 Answers  


1) How to retrieve RRN through RPG ? 2) How to pass parameter by value ? 3) How to trap the error through the RPG/400

10 Answers   IBM, Tech Mahindra,






What is the syntax of passing parameters to a procedure by value?

1 Answers  


Hi all friend, Could Any body send me the code (with coding) of this senario because I have tried but I am stucking somewhere so Please reply ASAp with coding. senario:Q: I have to write the flat file(FLAT1) into the three different PFS (PF1,PF2 and PF3) with the respect of H line data, D line data and Z line data of flat file. where I have different data in flat file(FLAT1) which is mentioned below with data. H0929200909282009092820095529420003000073 D2222220006765555webservi001633.9909222009092820090924200951 8564380134049ROSNER TOYOTA OF FREDE FREDERICKSBURVA 224080000USA840840001633.99001633.99851856492689800208001915 511001633.990408490000000.0000000003446048 1,3 110793145 09070700351 372367 Rosner Motors D3333320006774444webservi000271.2409222009092820090924200951 8564380134049ROSNER TOYOTA OF FREDE FREDERICKSBURVA 224080000USA840840000271.24000271.24851856492689800208001835 511000271.240930680000000.0000000003450293 1 110793254 09072100079 373933 Rosner Motors Z0929200900000020001905.25 FLAT1 has the three pf data H line-represents the header pf data,D-Represent Details pf data,Z-Represents the trailer pf data Now I have to write H line data of flat file into Header pf (PF1),D line data of flat into datails pf(PF2) and Z line data of flat file into pf(PF3) with the spefic position(H,D and Z data of flat file into PF1, PF2 and PF3) of flat file.

4 Answers   IBM,


How do I read records from Subfile? what is the purpose of READC explain with example?

4 Answers   IBM,


How to create a key field for a logical file inside RPG?

4 Answers   HSBC,


difference between CHAIN and READE?

8 Answers   HCL,


How Chain operation copies the record's data to the input buffer for the program?

0 Answers   IBM,


How to read alternative records in a pf by using rpg?

8 Answers   IBM,


Categories