Hi,
I am looking to create a table that only pulls the result MAR2019 from the MTH_END variable. MTH_END is a numeric variable (shown by the screenshot below) and I have already successfully done a left join to connect two datasets - all of my proc sql code has worked without this extra condition that I want to include but I am not sure how to complete the line below (highlighted in red), given that MAR2019 is a mixture of components. Can someone please help with completing the line below ('a.cards_2019 is the dataset that I have already successfully referenced after doing the left join)? Thanks.
where a.cards_2019= ????????????? ;
If you want month-end values only:
where a.cards_2019='31mar2019'd;
if you want the entire month
where '01mar2019'd <= a.cards_2019 <= '31mar2019'd;
Keep in mind that the MONYY7. Format will display 01mar2019 the same as 31mar2019: MAR2019
Let me know is it makes sense 🙂
please try
where a.cards_2019= 21609;
If you want month-end values only:
where a.cards_2019='31mar2019'd;
if you want the entire month
where '01mar2019'd <= a.cards_2019 <= '31mar2019'd;
Keep in mind that the MONYY7. Format will display 01mar2019 the same as 31mar2019: MAR2019
Let me know is it makes sense 🙂
Hi @jeremy4 Sorry for the late entry, for what it's worth
the expression also can be written as
where put(a.cards_2019,monyy7.)='MAR2019';
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.