BookmarkSubscribeRSS Feed
SAShole
Pyrite | Level 9

Hello SAS Community,

I'm using proc x11 to run a forecast on multiple areas. is there a way i can request specific tables for each area, with out typing out all areas?

For example, my current code looks something like this:

proc x11 data = have;

    monthly date = time_key;

    var   baton_rouge Cleveland    Connecticut;

    output out=want                            

               b1=baton_rouge_orig Cleveland_orig    Connecticut_orig   

               d11=baton_rouge_adj Cleveland_adj    Connecticut_adj;

run;

I tried using _all_ for the var statement and that worked but i can't figuire it out for specific tables

Thank you,

1 REPLY 1
udo_sas
SAS Employee

Hello -

You might consider reading all variable names into a macro variable and then run X11.

As an example (I'm not filtering out the DATE variable I know - but it might be a start):

%macro lst(dsn);

   %global x;

   %let x=;

   %let dsid=%sysfunc(open(&dsn));

   %let cnt=%sysfunc(attrn(&dsid,nvars));

   %do i = 1 %to &cnt;

      %let x=&x %sysfunc(varname(&dsid,&i));

   %end;

   %let rc=%sysfunc(close(&dsid));

%mend lst;

%lst(sashelp.workers)

proc x11 data=sashelp.workers noprint;

   monthly date=date;

   var &x;

   tables b1 d11;

   output out=out b1=&x d11=&x;

run;

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 1158 views
  • 3 likes
  • 2 in conversation