DB2

895 pts.
Tags:
AS/400
DB2
RPG
i have display file which inputs a varibale say Var1....

This is updated in a PF. My problem is program is not updating this varibale in this file. it updates all other varibales...i checked the library list and evrythng is in place...

in PF, the field name is Var1. i use the same name for DSPF - Var1...

so in the program i dont have move statement..i simply update the file...cud this be the reason???



Software/Hardware used:
AS400 - RPG

Answer Wiki

Thanks. We'll let you know when a new response is added.

What order are you issuing
EXFMT
CHAIN or READ
UPDATE
?
Phil
———————-
yes.. exactly… .. what?

Performs an update .. with a native I/O UPDATE command?
F-spec doesn’t have a prefix keyword

You are saying that in debug you do an EVAL var1 just before the udpate and it’s good
What happens if you do EVAL var1 just after the update?
Phil

———-
Are you updating the physical file or through a logical file?
Phil

——————————
with native I/O UPDATE command?
No prefix on the F-Spec
No rename of fields
It’s been compiled over the PF with the field

order of events
chain/read
exfmt dspfrecord
update record

Phil
—————-
“What happens if you do EVAL var1 just after the update? – it looks good too.”
Then it cannot be recognizing the var1 as a part of the record that is updated.

Phil
————————-
F-spec ‘E’xternally defined?? or ‘F’ixed format?
Phil

——————————

If the sequence is to do an EXFMT with that variable name defined in the display format, <b>then</b> CHAIN / READ a record from the file with the same variable name defined in the record format, the contents of the variable are being replaced by the last operation.

Either load the variable from the file prior to displaying it on the screen (if the current value needs displaying) or use a different name for the variable on the display format.

Splat

——————————

Phil,

My apologies. I didn’t see your comment about the sequence of events until after I’d posted the above.

Splat
————-
Don’t apologize for trying to help..the key was his response — the value was in the field even after the update .. I don’t think his program sees the field in the file .. thus the question about Fixed format …
Phil

——————
Please tell the problem/solution .. it might help others.
Phil

Discuss This Question: 4  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Nutangujar
    yes.. exactly... in debug mode i checked the value of var1 and it looks ok...after that it performs update... one point here is this is the maintenance program var1 is the new field added to database PF... and i'm modifying the existing program to just add this new variable....i checked the source code for the newly added field and there appears to be no constraint added in the code for var1
    895 pointsBadges:
    report
  • Nutangujar
    i'm updating directly the PF
    895 pointsBadges:
    report
  • Nutangujar
    What happens if you do EVAL var1 just after the update? - it looks good too.
    895 pointsBadges:
    report
  • Nutangujar
    Thanks you all for your help... I got my program running now... -NG
    895 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following