Rocket U2 | UniVerse & UniData

 View Only
  • 1.  Multiple Selects from Basic program

    Posted 07-26-2024 16:09

    I noticed that when I executed two select statements in a basic program, the 2nd one does NOT utilize the results from the first one:

    CMD1='SELECT FILE WITH ATTR1 EQ "Y"''

    EXECUTE CMD1

    CMD2-'SORT FILE F1 F2 F3 F4'

    EXECUTE CMD2

    But, if I combine them it works:

    MULTI.CMD=CMD1:@AM:CMD2

    EXECUTE MULTI.CMD

    Problem: is there a way to keep the 2nd command from running if the CMD1 finds 0 records?



    ------------------------------
    Nelson Schroth
    president
    C3CompleteShop LLC
    Harrison OH US
    ------------------------------


  • 2.  RE: Multiple Selects from Basic program

    Posted 07-26-2024 16:55

    In Unidata, you could conditionally execute the second one only if either @SYSTEM.RETURN.CODE or SYSTEM(11) is greater than or equal to 1:

    CMD1='SELECT FILE WITH ATTR1 EQ "Y"''

    EXECUTE CMD1

    IF @SYSTEM.RETURN.CODE GE 0 THEN

    CMD2-'SORT FILE F1 F2 F3 F4'

    EXECUTE CMD2

    END



    ------------------------------
    Shawn Waldie
    enterprise application developer
    Rocket Forum Shared Account
    Los Angeles CA US
    ------------------------------



  • 3.  RE: Multiple Selects from Basic program

    Posted 07-26-2024 17:15
    Edited by Christine Rizza 07-26-2024 17:15

    EXECUTE CMD2:' REQUIRE.SELECT'



    ------------------------------
    Doug Averch
    Owner
    U2 Logic
    ------------------------------



  • 4.  RE: Multiple Selects from Basic program

    Posted 07-29-2024 08:38

    Doug,

    Explain 'RETURN.SELECT'.  not in any UniVerse manuals and I am not sure how to utilize it.

    Nelson



    ------------------------------
    Nelson Schroth
    president
    C3CompleteShop LLC
    Harrison OH US
    ------------------------------



  • 5.  RE: Multiple Selects from Basic program

    Posted 07-29-2024 08:42

    SORRY - REQUIRE.SELECT.

    is this an option for EXECUTE?



    ------------------------------
    Nelson Schroth
    president
    C3CompleteShop LLC
    Harrison OH US
    ------------------------------



  • 6.  RE: Multiple Selects from Basic program

    Posted 07-29-2024 09:15

    my problem was a missing space after the quote and before the REQUIRE.SELCT.

    thanks for the tip!



    ------------------------------
    Nelson Schroth
    president
    C3CompleteShop LLC
    Harrison OH US
    ------------------------------



  • 7.  RE: Multiple Selects from Basic program

    Posted 07-27-2024 06:15

    Hello Nelson

    Have a look to EXECUTE / RTNLIST / PASSLIST

    I hope this help. 



    ------------------------------
    Manu Fernandes
    ------------------------------