BookmarkSubscribeRSS Feed
DB_ECON
Calcite | Level 5
%do %until (&Max_V1. le 5);

a few more lines of code goes here........then ......

proc sql;
Select Variable INTO: Drop_Var
from Spdework.varlist where VarianceInflation = (select max(Varia) as MV
from varlist);
quit;
Question
*At each iteration &Drop_Var contains a new variable. How can I create a new Dataset at this stage to hold all variables generated by &Drop_Var as observations.


proc sql;
Select Variable INTO: L_F_Vars SEPARATED by ' '
From Varlist
Where Variable "&Drop_Var.";
quit;



%END;

%mend auto_vif;

Message was edited by: DB_ECON Message was edited by: DB_ECON
1 REPLY 1
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
You will need to generate the SAS code and use CREATE TABLE, or consider a DATA step approach where you can create more than one SAS member/table with a single pass of an input file, again with your SAS macro code needing to generate the DATA statement parameters and associated OUTPUT statements.

Scott Barry
SBBWorks, Inc.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 662 views
  • 0 likes
  • 2 in conversation