DATA Step, Macro, Functions and more

Change in length of character data type while creating table backup using PROC SQL

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 5
Accepted Solution

Change in length of character data type while creating table backup using PROC SQL

[ Edited ]

When we create backup of a table using below lines of codes, it quadruples the length of character variable. However, length of Number variables remains unchanged (refer to below screen shots).

 

PROC SQL;

CREATE TABLE <NEW TABLE NAME> AS

SELECT * FROM <EXISTING TABLE NAME>;

QUIT;

 

Length1.JPGLength4.JPG

 

Why is it so? Here, Database is Oracle. I'm not sure if this happens across all DB servers.


Accepted Solutions
Solution
‎02-15-2017 06:04 AM
Super User
Super User
Posts: 7,401

Re: Change in length of character data type while creating table backup using PROC SQL

Different systems have different defaults and assumptions.

For instance, in your pictures, in the Oracle DB numeric length is 16, in SAS it is 17, this is due to SAS including '.' as a character, where Oracle does not.  As for the character length, maybe this post will help, it is the storage difference between them.

https://communities.sas.com/t5/SAS-Data-Management/Oracle-column-length-increase-when-metadata-is-re...

 

Shouldn't make any difference though.

View solution in original post


All Replies
Solution
‎02-15-2017 06:04 AM
Super User
Super User
Posts: 7,401

Re: Change in length of character data type while creating table backup using PROC SQL

Different systems have different defaults and assumptions.

For instance, in your pictures, in the Oracle DB numeric length is 16, in SAS it is 17, this is due to SAS including '.' as a character, where Oracle does not.  As for the character length, maybe this post will help, it is the storage difference between them.

https://communities.sas.com/t5/SAS-Data-Management/Oracle-column-length-increase-when-metadata-is-re...

 

Shouldn't make any difference though.

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 1 reply
  • 146 views
  • 0 likes
  • 2 in conversation