BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
dipand
Quartz | Level 8

I have a daatset .sas7bdat and I need to convert the column format chart into varchar.

If I create a structure table with SAS Studio receive this error:

 

One or more variables were converted because the data type is not supported by the V9 engine.

 

I understand that is necessary to create the table structure on Cas, but I don't know a way for insert the data on the table.

 

this is my code for insert dataset on CAS:


proc cas;
upload / path="&path/inspection_question_answer.sas7bdat" casout={caslib="hseq" name="HSEQ4A_INSPECT_ANSWER_QUESTION1" replication=0};
quit;


proc casutil incaslib="hseq" outcaslib="hseq";
droptable casdata="HSEQ4A_INSPECT_ANSWER_QUESTION" quiet;
promote casdata="HSEQ4A_INSPECT_ANSWER_QUESTION1" casout="HSEQ4A_INSPECT_ANSWER_QUESTION";
save casdata="HSEQ4A_INSPECT_ANSWER_QUESTION" casout="HSEQ4A_INSPECT_ANSWER_QUESTION" replace;
quit;

 

 

But this table is actually very large and my client asked to convert char columns to varchar, but at the moment I can’t get it done

 

 

Any suggestions?

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
BrunoMueller
SAS Super FREQ

Use this option in your UPLOAD statement it will change CHAR to VARCHAR whenever the length is greater or equal to 17. A VARCHAR column has a 16byte overhead so it only makes sense to convert longer CHAR vars.

 

importoptions={filetype="BASESAS" varcharConversion=17}

View solution in original post

1 REPLY 1
BrunoMueller
SAS Super FREQ

Use this option in your UPLOAD statement it will change CHAR to VARCHAR whenever the length is greater or equal to 17. A VARCHAR column has a 16byte overhead so it only makes sense to convert longer CHAR vars.

 

importoptions={filetype="BASESAS" varcharConversion=17}

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

Discussion stats
  • 1 reply
  • 3201 views
  • 2 likes
  • 2 in conversation