The syntax for taking out all carriage return ('OD'x) and line feed ('OA'x) characters is comment= Compress(comment,'0D0A'x); comment= TRANWRD(comment,'0D0A'x,’’); If you just want to take out the Carriage Return, use this code: comment= TRANWRD(comment,'0D'x,''); Sarath www.studysas.blogspot.com
... View more
Using 2 SET Statements in a single datastep:
Here is the code:
data l4;
set l2;
n=_n_;
if missing(quantity) then do;
do until (not missing(quantity));
n=n-1;
set l2(keep=quantity) point=n; *second SET statement;
end;
end;
run;
Sarath Annapareddy
http://studysas.blogspot.com/2008/10/lag-function-how-to-obtain-information.html
... View more
/*Put all the variables into Alphabetical order;*/
data fin;
input w a x z p;
cards;
1 2 3 5 6
run;
proc sql noprint;
select name into: new separated by ','
from dictionary.columns where libname='WORK' and memname='FIN'
order by name;
create table fin_1 as select &new. from fin;
run;
Read more : http://studysas.blogspot.com/2009/07/dictionary-tables-and-sashelp-views.html
Sarath
... View more
* Using SASHELP Views ( vextfl) to get the filename or pathname;
*To get the filename only;
data _null_;
set sashelp.vextfl(where=(upcase(xpath) like '%.SAS'));
call symput('program', scan(xpath,-1,'\'));
run;
*To get pathname;
data _null_;
set sashelp.vextfl
(where=(upcase(xpath) like '%.SAS'));
call symput('progrm', xpath);
run;
Read more at: http://studysas.blogspot.com/2009/04/how-to-determine-executing-program-name.html
Sarath
... View more