BUILTIN FUNCTION..

310 pts.
Tags:
RPG Functions
RPG ILE
RPGLE
HOW CAN WE CHECK THE EXISTANCE OF ANY RECORD IN ANY PF WITHOUT READING THE FILE IN RPGILE . . IS THERE ANY BUILT IN FUNCTION  THANKS/

Answer Wiki

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

Use the SETLL instruction.
This will seton an indicator if record exists, but does not bring the data into your program

=======================================================

SELECT count(*) FROM file Where <condition>

Specify the conditions to recognize the record. See if the count is zero or greater than zero.

But it doesn’t make much sense — what do you mean by checking in ILERPG “WITHOUT READING THE FILE”? (And why are you shouting?) Why does it need to be in ILERPG? Do you mean you don’t want the file read at all or that you don’t want to code any reading of the file?

Tom

Discuss This Question: 9  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
  • mcarpntr
    You can test for the number of records or number of deleted records in a file with cl. command RTVMBR for file to retrieve NBRCURRCD or NBRDLTRCD. This is helpful on file reorganizations etc....
    135 pointsBadges:
    report
  • philpl1jb
    Sounds like a homework question.
    49,960 pointsBadges:
    report
  • Ambrish 82
    thanks to all of u... i just wanted to know is there any built in function in ile rpg to do like that...
    310 pointsBadges:
    report
  • philpl1jb
    yes %setll
    49,960 pointsBadges:
    report
  • philpl1jb
    No, not really .. %setll seemed great at 5:30 am but it's not real.
    49,960 pointsBadges:
    report
  • philpl1jb
    once you've issued the setll command the function %equals will indicate if the record exists.
    49,960 pointsBadges:
    report
  • Satsho
    Alternatively, %FOUND can also be used. However, as a rule, I've used %EQUAL for SETLL and %FOUND for CHAIN.
    1,245 pointsBadges:
    report
  • TomLiotta
    SETLL should not indicate if a matching record exists with %FOUND. It indicates only if the 'lower limit' fits the records in a file, i.e., if the 'lower limit' is found which might not be an exact match. If a file contains 1 and 3, then SETLL 2 should indicate "found" because 3 is in its proper place. This parallels the behavior of the NR indicator position though with the opposite values. However, %EQUAL should work the same for both SETLL and CHAIN. The difference should be that CHAIN also will read the record that matches while SETLL requires an additional op-code such as READ to bring the record. This parallels the behavior of the EQ indicator position. Tom
    125,585 pointsBadges:
    report
  • Kathan
    you can use runqry with record selection parameter or you can use wrkqry or opnqry from command line.
    70 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