BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
zhangda
Fluorite | Level 6

Hello,

 

Why there is nothing for table stack_monthly? Anything wrong with the macro? I attached part of the data for chargedisb. Please help, thanks!

 

%macro pull(stack, where);
PROC SQL;
CREATE TABLE &stack. AS
SELECT
*
FROM
chargedisb
&WHERE.

%mend;


%pull(stack_monthly, where month3 ='January' );
%pull(stack_ytd, where month3 is not null );

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

Many users here don't want to download Excel files because of virus potential, others have such things blocked by security software. Also if you give us Excel we have to create a SAS data set and due to the non-existent constraints on Excel data cells the result we end up with may not have variables of the same type (numeric or character) and even values.

 

The instructions here will allow you to create data step code that you can paste to the forume or attach as a TEXT file to create a data set we can test code against: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat...

 

A very likely cause is that you are missing a ; to end the create table statement and  missing quit; to end the Proc Sql

View solution in original post

2 REPLIES 2
ballardw
Super User

Many users here don't want to download Excel files because of virus potential, others have such things blocked by security software. Also if you give us Excel we have to create a SAS data set and due to the non-existent constraints on Excel data cells the result we end up with may not have variables of the same type (numeric or character) and even values.

 

The instructions here will allow you to create data step code that you can paste to the forume or attach as a TEXT file to create a data set we can test code against: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat...

 

A very likely cause is that you are missing a ; to end the create table statement and  missing quit; to end the Proc Sql

Astounding
PROC Star

Assuming you fix the errors already pointed out ...

 

It looks like your month values are centered.  The actual value would never be "January" because there would be leading blanks.  In SAS, "January" and "   January" are different.

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!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 2 replies
  • 912 views
  • 0 likes
  • 3 in conversation