BookmarkSubscribeRSS Feed
geds133
Calcite | Level 5

proc sql;
CREATE TABLE WORK.twentyeighteen AS
SELECT
a.*,
INPUT(put(TransactionDate,8.),yymmdd8.) AS TransactionDate format ddmmyy10.
FROM
database.td AS a
WHERE
TransactionDate > 20180101;
quit;

 

 

proc sql;
CREATE TABLE WORK.trans AS
SELECT
SUM(CashValue + ChequeValue + TransferValue) as TotalDeposit,
MONTH(TransactionDate) AS month
FROM
WORK.twentyeighteen
WHERE
TransactionCode = 1 
GROUP BY
month
ORDER BY
month;
quit;

 

I don'y receive any errors but the result is only a single row instead of a list of deposits per month

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 15 replies
  • 9023 views
  • 1 like
  • 5 in conversation