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 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

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