[table] [tbody] [tr] [td class="votecell">
[/td] [td]
my code goes like this femp uf e k disk dvar1 s 5p 0 c *loval setll emp c read emp c dow not %eof(emp) C eval ecode = ecode + 10 c eval var1=ecode c update recemp
c var1 setgt emp c read emp c enddo c eval *inlr=*on
here is a file named emp with record format name recemp with ecode as the key ...now when i am reading the file and then updating the ecode without using setgt ..the pointer is not moving ahead it is updating the same ecode value many time ...now when i use set gt pointer picks the next record but it dint work when two ecode values are same ...else also it will not be working with descending key values...is there any solution so that i can set pointer regardless of the fact whether the values are same or ascending or descending .......thanks
[/td] [/tr] [/tbody] [/table]
Software/Hardware used:
as400
ASKED:
April 23, 2010 11:35 AM
UPDATED:
April 27, 2010 1:30 AM
Your code doesn’t explain what you are trying to do. You need to tell us what you want to happen; then we can suggest ways to change your code.
If you paste code here, click the <code> before you paste and after you paste, or paste all of your code, then select all of the code and click the <code> button. The <code> button tells the editor that it should present program code in a neat format.
What are you trying to do?
SETGT and SETLL work fine, but we can’t tell you how to use them until we know what you are trying to accomplish.
Tom
As Tom said, specs are unclear.
If you are trying to update every records key value.
You can do this easier by
1. Changing the F spec – remove the K
2. Remove the setGT
Phil
That’s not a spec. Describe what you want to change.
Perhaps it’s to increase ecode by 10 for every record in the file?
Phil
Describe to us what you want to happen. The program doesn’t things that make a lot of sense.
If your file had these values for ECODE, what values should be in the file after you run:
If you show us how the values should be updated, that should tell us what you want done.
Tom