Top "Sas-macro" questions

A metaprogramming language used in the SAS suite to modify normal SAS code at run-time.

Using SAS Macro to pipe a list of filenames from a Windows directory

I am trying to amend the macro below to accept a macro parameter as the 'location' argument for a dir …

sas pipe sas-macro dir file-io
Is it possible to loop over SAS datasets?

I have 60 sas datasets that contain data on consumers individual characteristics such as id, gender, age, amountSpent, .... Each dataset shows …

sas sas-macro
SAS: Calling one macro from another...Order of Macro Definitions

In my code I have several macros. Macro A is the main macro. Macro A then calls macro B which …

sas sas-macro
SAS variable concatenation through data step

I am looking for a way to create a string variable containing certain values of the dataset while going through …

variables sas sas-macro datastep
Macro returning a value

I created the following macro. Proc power returns table pw_cout containing column Power. The data _null_ step assigns the …

sas sas-macro
Concatenate quoted macro variables

I'm just trying to concatenate two quoted macro variables but there doesn't seem to be an easy way. Say we …

sas concatenation sas-macro
Open code statement recursion detected during exporting a file

I try to export a file in SAS but I get "Open code statement recursion detected." error. Since I export …

recursion sas export sas-macro datastep
Substitute text in a macro variable in SAS

I want to change any instances of a period in a macro variable to underscore. What am I doing wrong? %…

sas sas-macro
Macro sas difference between %str and %bquote

Sample Code :- %Let a = begin; %let b1 = %str(&a); %let b2 = %nrstr(&a); %let b3 = %bquote(&…

sas sas-macro
Using SAS to delete a text file

Am looking for a piece of code, preferably OS independent and macro based, for deleting a text file (or any …

sas sas-macro