+ Reply to Thread
Page 1 of 3 1 2 3 LastLast
Results 1 to 10 of 21

Thread: BIF %Found trouble

  1. #1
    Guest.Visitor Guest

    Default BIF %Found trouble

    Has anyone had any trouble using %Found on a SetLL???? I am having a problem with this in my program and no it isn't working properly. Has anyone applied a PTF that fixed it??? I can't figure out why it doesn't work. * C MSTPKEY SETLL TSLSTOP5 C IF %FOUND(TSLSTOP5) Here is my code, and I know for a fact the record doesn't exist, but it passes the check and executes the rest of the code.

  2. #2
    B.Myrick Guest

    Default BIF %Found trouble

    Trevor, I will try this on my machine. I don't use this method, but I was wondering: Since this is an op code associated with READx, perhaps the %EOF bif would be better suited for this operation. -bret

  3. #3
    Guest.Visitor Guest

    Default BIF %Found trouble

    Thanks Bret, I have used it like this at a previous shop, but can't seem to get it to work here. Out on the redbooks it says that it can be used for the following, so it SHOULD work, but ya know how that goes :-). File Operations: Chain Delete SetGt SetLL String Ops: Thnx for checking Trev Check CheckR Scan Search: LookUp

  4. #4
    Guest.Visitor Guest

    Default BIF %Found trouble

    Trevor, You want %Equal, not %Found. From the manual:
     The resulting indicators reflect the status of the operation. You can specify an indicator in positions 71-72 that is set on when the search argument is greater than the highest key or relative record number in the file. This information can also be obtained from the %FOUND built-in function, which returns '0' if no record is found, and '1' if a record is found. You can specify an indicator in positions 75-76 that is set on when a record is present whose key or relative record number is equal to the search argument. This information can also be obtained from the %EQUAL built-in function, which returns '1' if an exact match is found. 
    Bill

  5. #5
    B.Myrick Guest

    Default BIF %Found trouble

    Trevor, Here is what I wrote: *************** Beginning of data ****************** foehdrflg if e k disk c key klist c kfld oeord# c kfld oeosfx c eval oeord# = 1 c key setll oehdrflg c if %found c eval oeosfx = 123 c oeosfx dsply c endif c oeosfx dsply c eval *inlr = *on ****************** End of data ********************* Order # 1 does not exist in the OEHDRFLG file. I know the %found does not indicate a found record in this instance. This is again confirmed when the DSPLY of OEOSFX results in '0' (ZERO). -bret

  6. #6
    B.Myrick Guest

    Default BIF %Found trouble

    Bill, Good point, but in many cases I don't want %equal, because I am positioning inside the file, based on data entered by the user. Don't expect too many exact matches when they key in a part description or customer name. -bret

  7. #7
    Guest.Visitor Guest

    Default BIF %Found trouble

    Bret, I agree, but in the "usual" circumstances, a Setll preceedes a Read which is looped. In this case any kind of conditioning on the Setll is superfluous. The only good use for the %Found condition that I can think of right now would be to use a conditional logic branch to load a "No records found at search position" message in a subfile. This would be a bit neater than checking the RRN of the subfile to see if any records had been loaded. Bill

  8. #8
    Guest.Visitor Guest

    Default BIF %Found trouble

    Bill, Basically in my application, I know that the record does not exist therefore, when using the %Found it should be '0'........it is not though, it is coming back as a '1' as if it found it. If I were to use the %Equal why would this work and not the %Found. Trev

  9. #9
    Guest.Visitor Guest

    Default BIF %Found trouble

    Bret, With the code you provided, did this work for you???? -Trev

  10. #10
    B.Myrick Guest

    Default BIF %Found trouble

    Yes it worked. Otherwise I would not have put it on the forum. Quite an EGO I have actually. Did you have problems with it compiling? I am on V4R4M0 if that makes any difference. What results (if any) did you get? -bret

+ Reply to Thread
Page 1 of 3 1 2 3 LastLast

Similar Threads

  1. Trouble with TABS?
    By dsmith@dse.com.au in forum Dev Tools
    Replies: 0
    Last Post: 12-18-2003, 07:02 PM
  2. Trouble Compiling
    By Guest.Visitor in forum Dev Tools
    Replies: 1
    Last Post: 12-15-2003, 11:17 AM
  3. A little OpsNav trouble...
    By J.Pluta in forum Networking
    Replies: 7
    Last Post: 02-09-2001, 10:10 AM
  4. CrtMail API trouble
    By Guest.Visitor in forum Application Software
    Replies: 8
    Last Post: 04-13-2000, 08:04 PM
  5. Trouble Connecting to AS/400
    By Guest.Visitor in forum Analysis
    Replies: 0
    Last Post: 01-01-1995, 02:00 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts