Hi,
I'm working on a simple report and getting stuck at a point
I'm running below snippet for printing the data after all the work is done
PROC PRINT DATA = R LABEL NOOBS ;
VAR TRAN_DATE
DEP_AMTN
TRANRMKS ;
SUM DEP_AMTN ;
BY T_MONTH ;
WHERE DEP_AMTN > 0 ;
RUN ;
I'm getting the expected output but with a "T_MONTH" on the left side of the total amount generated by SUM(DEP_AMTN) statement as below
TRANSACTION MONTH=1
TRANSACTION DEPOSIT
DATE AMOUNT TRANSACTION REMARKS
02-Jan-2015 100.00 ABCDEF
30-Jan-2015 48953.00 GHIJKL
----------- ------------
T_MONTH 49053.00
Could anyone help me to get rid of it ?
Hi data_null_,
Thank you for your response, I'm running this code in z/Os environment, perhaps I should have begin with this in my first post.
If I use SUMLABEL alone with LABEL (as below)
PROC PRINT DATA = R LABEL SUMLABEL NOOBS ; VAR TRAN_DATE DEP_AMTN TRANRMKS ; SUM DEP_AMTN ; BY T_MONTH ; WHERE DEP_AMTN > 0 ; RUN ;
then I get below output
TRANSACTION MONTH=1 DEPOSIT TRANSACTION DATE AMOUNT TRANSACTION REMARKS 02-Jan-2015 100.00 ABCDEF 30-Jan-2015 48953.00 GHIJKL ----------------- ------------ TRANSACTION MONTH 49053.00
T_MONTH is now TRANSACTION MONTH
But when I try using NOSUMLABEL or SUMLABEL='RTM' then SAS displays below error message:
ERROR 22-322: Syntax error, expecting one of the following: ;, BLANKLINE, DATA, DOUBLE, HEADING, LABEL, N, NOOBS, OBS, ROUND, ROWS, SPLIT, STYLE, SUMLABEL, UNIFORM, WIDTH.
Can you please help?
Please show the code you attempted to use that generated the error message. You may have set the option incorrectly.
Hi ballardw,
I used below code
PROC PRINT DATA = R NOSUMLABEL NOOBS ; VAR TRAN_DATE DEP_AMTN TRANRMKS ; SUM DEP_AMTN ; BY T_MONTH ; WHERE DEP_AMTN > 0 ; RUN ;
Hi Data _null_,
Thank you for your promt response, I'm running this on 9.3 so till our SAS gets upgraded to 9.4 I'll keep this in progress
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.
Ready to level-up your skills? Choose your own adventure.