usage of figurative constant *loval with Setll

95 pts.
Tags:
AS/400
AS400 RPGLE
Settl *loval usage
I got a compilation error  "*RNF7055 30      1 Factor 1 is not valid for the specified operation." for the following piece of code Filename    if   e             disk    *loval        setll     Filename   For the same code when i changed the F spec specifying the file as keyed (K) it dint throw any error ...just compiled. Please let me know whats the exact concept behind this. Note : For same code if i replace with *Hival and F spec non keyed then no compilation  error

Software/Hardware used:
AS400-RPGLE
ASKED: December 21, 2011  5:15 PM
UPDATED: March 17, 2012  6:10 AM

Answer Wiki

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

when you assigned k field. it access the record using keyed sequence access path..
but if you didn’t assign k field. it doesn’t consider key field while record accessing..

just try like this:

Filename if e disk recno(var1)
var1 s p 0 inz(1)
var1 setll Filename

use recno keyword in F -spc…

Discuss This Question: 5  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
  • philpl1jb
    Wow, with my memory, I learn something new every few minutes. Here's a discussion on your issue: http://www.mcpressonline.com/programming/rpg/dont-be-misled-by-setll-*loval.html Looks like you should use *START and *END (that's if you are on V5r4 or above). But you could also use the value 1 with the SETLL for a non-keyed file on any version. Phil
    48,565 pointsBadges:
    report
  • TomLiotta
    when i changed the F spec specifying the file as keyed (K) it dint throw any error That's how it's defined in the RPG manual:
    • If access is by key, search-arg can be a a single key in the form of a field name, a named constant, a figurative constant, or a literal.
    And the RNF7055 message gives an explicit mention:
    • -- For relative record number processing the Factor 1 operand must be numeric with zero decimal positions.
    But if access is by relative record number (not keyed), try using *START instead of *LOVAL. Tom
    125,585 pointsBadges:
    report
  • TomLiotta
    Looks like you should use *START and *END (that’s if you are on V5r4 or above). Fortunately, *START and *END go back quite a ways before V5R4. Tom
    125,585 pointsBadges:
    report
  • philpl1jb
    Thanks Tom, i stand corrected, again! *START and *END were introduced with V4R4. It seems like only yesterday. Phil
    48,565 pointsBadges:
    report
  • TomLiotta
    If your memory holds up, remind me to get my eyes checked before I try a *QRYDFN instead of OPNQRYF. Tom
    125,585 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