BookmarkSubscribeRSS Feed
saspert
Pyrite | Level 9

Hi,

I am trying to convert a numeric year to a character year field. 

 

   put(VW_client_Social.BroadCastYear,yyyy4.)  aS BroadCastYear_chr

 

works just fine in SAS EG but when I try the same expression in VA 7.1 , I get this error -

 

ERROR: The format YYYY was not found or could not be loaded.
ERROR: Character expression requires a character format.
3 Th

 

Thanks,
saspert.

4 REPLIES 4
Reeza
Super User
Shouldn't it be year4.?
saspert
Pyrite | Level 9

if I change yyyy4. to year4, Sas eg runs fine but returns 1965 as the output

 

while SAS VA gives the below error  - 

ERROR: Character expression requires a character format.

Reeza
Super User
It sounds like your variable in VA isn't numeric. Verify the variable type.
MichelleHomes
Meteorite | Level 14

Date manipulation in SAS Visual Analytics needs to be done differently than Base SAS. There is no put function available. You need to use the TreatAs function. See this recent post for ideas https://communities.sas.com/t5/SAS-Visual-Analytics/How-to-calculate-age-from-birthdate-using-SAS-VA...

//Contact me to learn how Metacoda software can help keep your SAS platform secure - https://www.metacoda.com

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!

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
  • 4 replies
  • 1506 views
  • 2 likes
  • 3 in conversation