Hi RW ,Thanks for Help. Below code is selecting the data set names , but it's throwing an error.Could you please help on fixing this.Below are Error logs. /*Code*/ data _null_; set sashelp.vtable (where=(libname="STSTGTBL")); call execute(cats('proc sort data=STSTGTBL.',memname,' out=dist_',memname,' nodupkey; by _all_; run;')); run; /*Error1*/ 24 data _null_; 25 set WORK.QUERY_FOR_AAA (where=(Library_Name="STSTGTBL")); 26 call execute(cats('proc sort data = STSTGTBL. ',Table_Name,'out= dis_',Table_Name,'nodupkey; by _all_; run;')); 27 run; NOTE: There were 131 observations read from the data set WORK.QUERY_FOR_AAA. WHERE Library_Name='STSTGTBL'; NOTE: DATA statement used (Total process time): real time 0.00 seconds cpu time 0.00 seconds NOTE: CALL EXECUTE generated line. NOTE: Line generated by the CALL EXECUTE routine. 1 + proc sort data = STSTGTBL.ABSENTEEISM_NGout= dis_ABSENTEEISM_NGnodupkey; by _all_; run; _ 22 76 ERROR 22-322: Syntax error, expecting one of the following: DATA, DUPOUT, IN, OUT, SIZE, SORTSEQ, SORTSIZE, T, TECH, TECHNIQUE, UNIOUT, UNIQUEOUT. ERROR 76-322: Syntax error, statement will be ignored. NOTE: The SAS System stopped processing this step because of errors. NOTE: PROCEDURE SORT used (Total process time): real time 0.00 seconds cpu time 0.00 seconds NOTE: Line generated by the CALL EXECUTE routine. 2 The SAS System 09:21 Tuesday, March 5, 2019 2 + proc sort data = STSTGTBL.ACTIVEDLYSNAPTILL30SEP2018_0000out= dis_ACTIVEDLYSNAPTILL30SEP2018_0000nodupkey; by _all_; run; _ 22 76 ERROR: Invalid data set name STSTGTBL.ACTIVEDLYSNAPTILL30SEP2018_0000out. ERROR 22-322: Syntax error, expecting one of the following: DATA, DUPOUT, IN, OUT, SIZE, SORTSEQ, SORTSIZE, T, TECH, TECHNIQUE, UNIOUT, UNIQUEOUT. ERROR 76-322: Syntax error, statement will be ignored. NOTE: The SAS System stopped processing this step because of errors. NOTE: PROCEDURE SORT used (Total process time): real time 0.00 seconds cpu time 0.00 seconds
... View more