Exploring, modeling, predicting and reporting with SAS Visual Analytics and SAS Visual Statistics

Format works in SAS EG but not in SAS VA 7.1

Reply
Super Contributor
Posts: 268

Format works in SAS EG but not in SAS VA 7.1

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.

Grand Advisor
Posts: 16,265

Re: Format works in SAS EG but not in SAS VA 7.1

Shouldn't it be year4.?
Super Contributor
Posts: 268

Re: Format works in SAS EG but not in SAS VA 7.1

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.

Grand Advisor
Posts: 16,265

Re: Format works in SAS EG but not in SAS VA 7.1

It sounds like your variable in VA isn't numeric. Verify the variable type.
Super User
Posts: 1,202

Re: Format works in SAS EG but not in SAS VA 7.1

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...

Post a Question
Discussion Stats
  • 4 replies
  • 377 views
  • 2 likes
  • 3 in conversation