BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
sihlek
Calcite | Level 5

Hi, 

 

I am trying to convert a variable (External_nbr, this is a column variable with unique numbers of customers) from numeric to text, sas gives me this message:

 

put(External_nbr, 32);
___
180

ERROR 180-322: Statement is not valid or it is used out of proper order.

1 ACCEPTED SOLUTION

Accepted Solutions
Kurt_Bremser
Super User

When steps fail, please post the whole log of such a step by using the {i} button (to preserve content, formatting, and positioning).

What you most likely want to do

External_nbr_new = put(External_nbr,32.);

You have to create a new variable, as you can't change the type of an existing variable.

View solution in original post

4 REPLIES 4
KachiM
Rhodochrosite | Level 12

Perhaps a simple dot after 32 may do the magic. But you have to assign it to a new character variable suitably sized.

sihlek
Calcite | Level 5

Thank you for the help:)

Kurt_Bremser
Super User

When steps fail, please post the whole log of such a step by using the {i} button (to preserve content, formatting, and positioning).

What you most likely want to do

External_nbr_new = put(External_nbr,32.);

You have to create a new variable, as you can't change the type of an existing variable.

sihlek
Calcite | Level 5

Thank you:)

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!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 735 views
  • 0 likes
  • 3 in conversation