Arun_SP, This worked exactly as you wanted in SAS EG 5.1 in terms of stopping program execution (the count conditions are specific to my requirement): data _null_ ;
if &cnt > 0 then DO ;
PUT 'ERROR:There are CustomerGroup Numbers in the Plan B listing that are not themselves listed as CustomerNos also. Add these to the dataset cust_mapping_by_rank.' ;
ABORT CANCEL;
END;
if &cnt = 0 then DO ;
file print;
PUT 'All CustomerGroup Numbers in the Plan B listing are now listed themselves listed as CustomerNos also.';
end;
file log;
run ; ABORT CANCEL is the correct statment. The WORK library contents are retained and the SAS server is not disconnected. At the same time, no further programs from the SAS EG project are executed. Subsequent DATA / PROC segments within the same program are also NOT executed. An ERROR is written to the log. At least, this has been my experience.
... View more