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
------------------------------
EXECUTE CMD2:' REQUIRE.SELECT'
------------------------------
Doug Averch
Owner
U2 Logic
------------------------------
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
------------------------------
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
------------------------------
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
------------------------------
Hello Nelson
Have a look to EXECUTE / RTNLIST / PASSLIST
I hope this help.
------------------------------
Manu Fernandes
------------------------------
EXECUTE CMD2:' REQUIRE.SELECT'
------------------------------
Doug Averch
Owner
U2 Logic
------------------------------
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
------------------------------
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
------------------------------
SORRY - REQUIRE.SELECT.
is this an option for EXECUTE?
------------------------------
Nelson Schroth
president
C3CompleteShop LLC
Harrison OH US
------------------------------
SORRY - REQUIRE.SELECT.
is this an option for EXECUTE?
------------------------------
Nelson Schroth
president
C3CompleteShop LLC
Harrison OH US
------------------------------
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
------------------------------