PDA

View Full Version : INFDS und Post?



robertki
24-01-07, 11:51
Hallo,

ich habe da mal eine Frage: Wie funktioniert das mit dem Post bei INFDS? Ich habe folgenden Code geschrieben:



C Post PANRAKTD2 PDINFDS
C EVAL msg = PGM_DEV_P
C msg DSPLY


PANRAKTD2 ist mein Display File.
PDINFDS die DS.

Nun habe ich das Problem, dass die meisten Felder einfach gar nicht gefüllt sind, oder irgendwelche Zeichen enthalten. Was mache ich da falsch? Bzw. hat jemand ein Beispiel für mich wie der Post auszuführen ist?

Robert

Fuerchau
24-01-07, 11:59
Die INFDS muss in den F-Bestimmungen angegeben werden !

Ansonsten benötigst du den POST überhaupt nicht, da die INFDS automatisch nach jeder E/A-Operation aktualisiert wird.

robertki
24-01-07, 12:01
Die INFDS muss in den F-Bestimmungen angegeben werden !

Ansonsten benötigst du den POST überhaupt nicht, da die INFDS automatisch nach jeder E/A-Operation aktualisiert wird.

Hi,

F-Bestimmungen sieht wie folgt aus:



FPANRAKTD2 CF E WORKSTN INFDS(PDINFDS)


Das sollte doch funktionieren, oder?

Robert

Fuerchau
24-01-07, 13:31
So kenne ich es, aber:

Verwendest du die Anweisung POST wird nicht automatisch aktualisiert sondern nur wenn POST ausgeführt wird.
Lass einfach die Anweisung aus der Quelle raus.

robertki
24-01-07, 15:08
So kenne ich es, aber:

Verwendest du die Anweisung POST wird nicht automatisch aktualisiert sondern nur wenn POST ausgeführt wird.
Lass einfach die Anweisung aus der Quelle raus.

Wenn ich die Anweisung Post weglasse, dass passiert noch weniger!? In der Definition (http://www.code400.com/datastructures.php) steht extra dabei, dass vorher ein Post ausgeführt werden soll.

Robert

Fuerchau
24-01-07, 16:25
The POST operation puts information in an INFDS (file information data
structure). This information contains the following:
v File Feedback Information specific to RPG I/O for the file
v Open Feedback Information for the file
v Input/Output Feedback Information and Device Dependent Feedback
Information for the file OR Get Attribute Information
The program-device operand specifies a program device name to get information
about that specific program device. If you specify a program device, the file must
be defined as a WORKSTN file. If program-device is specified, then the INFDS will
contain Get Attribute Information following the Open Feedback Information. Use
either a character field of length 10 or less, a character literal, or a character named
constant. If program-device is not specified, then the INFDS will contain
Input/Output Feedback Information and Device Dependent Feedback Information
following the Open Feedback Information.
Specify the name of a file in the file-name operand. Information for this file is
posted in the INFDS associated with this file.
In free-form syntax, you must specify a file-name and cannot specify an INFDS
name. In traditional syntax, you can specify a file-name, an INFDS name, or both.
v If you do not specify an INFDS name, the INFDS associated with this file using
the INFDS keyword in the file specification will be used.
v If you do not specify an INFDS name in traditional syntax, you must specify the
data structure name that has been used in the INFDS keyword for the file
specification in the result field; information from the associated file in the file
specification will be posted.
To handle POST exceptions (file status codes greater than 1000), either the
operation code extender ’E’ or an error indicator ER can be specified, but not both.
For more information on error handling, see “File Exception/Errors” on page 65.
Even when a POST operation code is not processed, its existence in your program
can affect the way the RPG IV language operates. Usually, the INFDS is updated at
each input and output operation or block of operations. However, if anywhere in
your program, you have specified a POST operation with no program-device
specified, then RPG IV updates the I/O Feedback Information area and the Device
Dependent Feedback Information area in the INFDS of any file only when you
process a POST operation for that file. The File Dependent Information in the
INFDS is updated on all Input/Output operations. If you have opened a file for
multiple-member processing, the Open Feedback Information in the INFDS will be
updated when an input operation (READ, READP, READE READPE) causes a new
member to be opened.

Note that DUMP retrieves its information directly from the Open Data Path and
not from the INFDS, so the file information sections of the DUMP do not depend
on POST.
If a program has no POST operation code, or if it has only POST operation codes
with program-device specified, the Input/Output Feedback and Device Dependent
Feedback section is updated with each input/output operation or block of
operations. If RPG is blocking records, most of the information in the INFDS will
be valid only for the last complete block of records processed. When doing blocked
input, from a data base file, RPG will update the relative record number and key
information in the INFDS for each read, not just the last block of records
processed. If you require more accurate information, do not use record blocking.
See “File Information Data Structure” on page 65 for more information on record
blocking. If you do not require feedback information after every input/output
operation, you may be able to improve performance by using the POST operation
only when you require the feedback information.
When a POST operation is processed, the associated file must be open. If you
specify a program device on the POST operation, it does not have to be acquired
by the file.

Ich habe die POST-Anweisung noch nie verwendet und die INFDS ist immer korrekt gefüllt.

robertki
02-02-07, 11:12
Ich habe die POST-Anweisung noch nie verwendet und die INFDS ist immer korrekt gefüllt.

Hi Fuerchau,

ich habe es ausprobiert. Leider benötige ich einen POST! Ohne POST ist der Dev. Typ nicht gefüllt - mit schon. Anscheinend werden nur bei einigen Felder ein POST benötigt.

Robert

Fuerchau
02-02-07, 12:24
OK, dann musst du den POST allerdings immer dann aufrufen, wenn du auf die aktuellen Daten zugreifen willst.
Ansonsten ist nach READ/WRITE/EXFMT die INFDS ggf. nicht aktuell.

robertki
02-02-07, 12:27
Ja das stimmt. Für den device Typ ist dies nicht so wichtig, da er sich nicht während des Programmlaufs ändert. Also normalerweise ;-)

Robert