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

Hi. I am rather new to SAS programming. I need to get the result from a PROC SQL into an interim data set that I can process further. 

I got this PROC to give the Report below, after joining two small tables.

 

proc sql;

select FullMonthListMY, Go_LIVE_MNTH, Count
from WORK.FULL_CALENDAR_LIST LEFT JOIN CDTEMP8
ON FullMonthListMY=Go_LIVE_MNTH;

run;

 

Output Report:

FullMonthListMY   Go_LIVE_MNTH   Frequency Count

12/2017                       12/2017                    1

12/2017                        12/2017                   8

02/2018                              .                         .

03/2018                              .                         .

(etc)...

 

Two questions:

1. Can I replace all blanks with zero (numeric) in Frequency Count using code within this PROC.

2. How do I get this result out into an interim Dataset rather than a Report for further use. 

 

Thanks!I hope this is enough to give you the idea of what I am after.

1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User

proc sql;

 

create table want as

 

select FullMonthListMY, Go_LIVE_MNTH,    coalesce(Count,0) as Count
from WORK.FULL_CALENDAR_LIST LEFT JOIN CDTEMP8
ON FullMonthListMY=Go_LIVE_MNTH;

quit;

View solution in original post

2 REPLIES 2
Ksharp
Super User

proc sql;

 

create table want as

 

select FullMonthListMY, Go_LIVE_MNTH,    coalesce(Count,0) as Count
from WORK.FULL_CALENDAR_LIST LEFT JOIN CDTEMP8
ON FullMonthListMY=Go_LIVE_MNTH;

quit;

crawfe
Quartz | Level 8

Haha. Everything I tried unsuccessfully was much more complicated than what you

suggest. A good lesson in that...It worked just as needed. Thanks!

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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