SAS Proc Datasets - Change dataset name using macro variable -


i want change dataset names in sas using concatenated macro variables. using example code below error. syntax wrong or not possible use concatenating function in way?

code:

 %let term=201610;  %let emp='bob';   proc datasets library=work;  change testset = cat(&emp,&term);  run; 

errors received:

error 22-322: syntax error, expecting 1 of following: alter, memtype, mt, mtype, protect, pw, read, write.

error 76-322: syntax error, statement ignored.

you don't need concatenate macro variables, it's find , replace text. because have quotes right happen:

 change testset = cat('bob', 201610) 

but cat function not valid there. technically use %sysfunc() use cat function there's easier way.

 %let term=201610;  %let emp='bob';   proc datasets library=work;  change testset = &emp&term.;  run;quit; 

note proc datasets requires quit terminate.


Comments

Popular posts from this blog

PHP and MySQL WP -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

go - golang pprof for c library code -