08-23-2017 11:09 AM
I tried the following to resolve the three keyword parameters libname, dname and ordby.
so libname is passed &source is where the dataset(dname) events is present,I want to sort them in the order age,event_name,event_date.
I;m getting the following error:
ERROR: All positional parameters must precede keyword parameters.
MLOGIC(DERIVE_SEQNUM): Ending execution.
180: LINE and COLUMN cannot be determined.
NOTE: NOSPOOL is on. Rerunning with OPTION SPOOL might allow recovery of the LINE and COLUMN
where the error has occurred.
ERROR 180-322: Statement is not valid or it is used out of proper order.
create table &dname. as
order by &ordby.
08-23-2017 11:11 AM
ordby=age,event_name,event_date -> this is your issue.
The answer (from a decade ago) is here:
08-23-2017 11:37 AM
Sorry, its not entirely clear to me what this code is even to achieve? It seems like you could simplfiy this down to:
proc sort data=&source..events; by age event_name event_date; run;
The rest of it is just wasted characters. Then you "could" - although I see no benefit and lots of pitfalls - of macro'ing the code;
%macro Do_Sort (lib=,mem=,ord=);
proc sort data=&lib..&mem.; by &ord.; run;
%Do_Sort (lib=&source.,mem=events,ord=age event_name event_date);