Hello SAS Community,
I am writing to request assistance with an issue I'm encountering while reading data from PostgreSQL tables into SAS Studio using Viya4.
The Problem: When I read tables containing text columns, SAS seems to be interpreting them incorrectly. Instead of reading the original text values (e.g., size 4), the software defaults format, length and informat to $1025.
I've verified that all the text columns in my PostgreSQL tables are defined as "character varying." I'm unsure why SAS is assigning to 1025 instead of original size 4.
I would greatly appreciate it if you could help me understand why this is happening and suggest possible solutions to read data from my PostgreSQL tables.
Thanks & Regards,
Bhaskar
Usually it makes a difference what the data type is in the foreign database. Looking on-line I see four different character types in Postgresl.
The last two do NOT have anything that indicates the maximum length that SAS can use to determine how to define the SAS variable. In those cases SAS will normally use some default length like 4k bytes or the 1k bytes that you seem to be seeing.
What do you mean by "size 4"? Are you saying that the PostgreSQL table columns are VARCHAR(4) but SAS is converting them to CHAR(1024)?
Usually it makes a difference what the data type is in the foreign database. Looking on-line I see four different character types in Postgresl.
The last two do NOT have anything that indicates the maximum length that SAS can use to determine how to define the SAS variable. In those cases SAS will normally use some default length like 4k bytes or the 1k bytes that you seem to be seeing.
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!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.