You can use $status to see the status of an executed command (to see if there was an error or not). So normally $status will be 0 if a program exits without an error and something else if there is an error. Unfortunately 3dinfo doesn't exit with an error for non-existent datasets. A fix for that will be included in a future distribution, possibly the following this posting. In the meantime, it's fairly simple to get around that by using grep to find a specific string in the output with something like this.
% 3dinfo aklsjflkjas | & grep "Can't open"
*+ WARNING: Can't open dataset aklsjflkjas
% echo $status
0
% 3dinfo aklsjflkjas | & grep "Can't open"
*+ WARNING: Can't open dataset aklsjflkjas
% @ stat = ! $status
% echo $stat
1