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

CREATE TABLE Table_1
(
col1 NUMERIC(16, 12)
)

INSERT INTO Table_1
SELECT col1
FROM table_2;

 

How to replicate above code in SAS using proc SQL? if the length  of col1 from table 2 does not matches with 

col1 NUMERIC(16, 12) the program should show an error message.

Is it achievable in SAS using proc SQL?

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Kurt_Bremser
Super User

SAS has only one datatype for numbers: numeric (8 byte floating point, aka "real"). All numeric types defined in, say SQL, map to this; combining such datasets will work.

Only when you try to mix character with numeric, or character variables with different defined lengths, will you run into problems.

View solution in original post

1 REPLY 1
Kurt_Bremser
Super User

SAS has only one datatype for numbers: numeric (8 byte floating point, aka "real"). All numeric types defined in, say SQL, map to this; combining such datasets will work.

Only when you try to mix character with numeric, or character variables with different defined lengths, will you run into problems.

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!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 329 views
  • 1 like
  • 2 in conversation