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

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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
  • 259 views
  • 1 like
  • 2 in conversation