Yes, but do consider that each SAS MACRO variable would need to be unique-named (possibly using a numeric, incrementing suffix-character). I suppose the next question back to the OP is: what are you attempting to accomplish with generating "n" unique-named macro variables in a DATA step (presuming that is what you were referencing with "...inside a do loop")?
> Can I use CALL SYMPUT inside a loop to create
> multiple variables for use later?
yes you can.
I have found it most useful when a bunch of parameters are loaded from an excel range containing effectively, name/value pairs
data _null_ ;
set excel.parameter_range ;
call symputx( name, value ) ;
For the benefit of the OP, I encourage Peter.C to explain how such "a bunch of parameters" might be used in a SAS application, ideally with some specific purpose?
Possibly, these incoming data-values from an Excel document are being loaded to drive a SAS application with SAS macro variables, specifically those macro variables &xxxxxxxx by the value of "name" variable and containing a value represented by the current observation variable value for "value").
Honestly, just because you can isn't always a good use of exploiting a feature or capability -- much to my own dog's personal indulgence dismay.
You have described very well how these parameters are used in the application!
The application used these parameters to support a daily liquidity reporting process for a global banking group. Each subsidiary needs to provide it's report in the standard layout but each has many basic, simple differences. It was these differences where the parameter sheet in excel provide flexibility for the on- going support and use of the application by non-SAS users.
. Seldom did fundamental parameters change for a subsidiary but these did not need to be in code although they were prototyped with %let. Other parameters did change occasionally. Since these were quite different subsidiaries their data sources varied a lot. Supporting that, a set of parameters defined the frequency location and name pattern for the inputs One parameter even signalled that certain intermediate data files which could be useful for ad-hoc reporting should be kept.
I stand by my statement that the data step with call symputx() was very straightforward and effective.