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 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

Discussion stats
  • 1 reply
  • 292 views
  • 1 like
  • 2 in conversation