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
------------------------------
Original Message:
Sent: 07-26-2024 16:08
From: Nelson Schroth
Subject: Multiple Selects from Basic program
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
------------------------------