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}

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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