BookmarkSubscribeRSS Feed
SAS_1001
Obsidian | Level 7

Hello,

 

I'd like to format dates as follows.  I've a month variable created and showing as 1,2,3,4,5,6,7,8,9,10,11,12 and I want to format it to January, February, March, ........, December. So how can I format month numeric values in full month name in SAS VA ?

 

In addition, I need to filter data based on months so how can I create a dynamic month variable. I just need to show data for the last two month from the whole year data ?  Month variable is a category.

 

Thanks in advance !

5 REPLIES 5
SASKiwi
PROC Star

In SAS VA you should load "proper" SAS dates - SAS numeric variables with formats like DATE9. That way VA will automatically recognise these variables as dates and then you can use the VA data formatting options including the months as text.

SAS_1001
Obsidian | Level 7

I tried but I'm not seeing month as text option.  It's showing all numerical functions, such as comma, float, dollar, etc.  When I used SAS VA month function from the proper SAS Date, it has created 1,2,3,4, .... as month.  Not able to convert them as January, February, ...etc.

Thx.

SASKiwi
PROC Star

This is a screenshot from VA 7.4 of the format options for a SAS date in the Data Source Pane - is this what you are trying?

 

 screenshot21.jpg

 

 

SAS_1001
Obsidian | Level 7

okay, I was looking inside the designer.  Thanks for the info.

SASKiwi
PROC Star

Just to clarify the screenshot is from the Designer data source pane

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

Tips for filtering data sources in SAS Visual Analytics

See how to use one filter for multiple data sources by mapping your data from SAS’ Alexandria McCall.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 5 replies
  • 1899 views
  • 0 likes
  • 2 in conversation