Hello statalister,
I've been trying to export a large dataset from stata to SAS but I'm consistently encountering an error.
There are several variables for which the export is not allowed, and the following error is displayed:
I've tried to "trim" the variables in order to remove blanks as shown in the help for SAS related export commands, but there is no replacement with the various *trim functions
Thank you for your kind help
I've been trying to export a large dataset from stata to SAS but I'm consistently encountering an error.
There are several variables for which the export is not allowed, and the following error is displayed:
Code:
fdasave "my_database.sas",rename replace *Error below active_drug_1, active_drug_2, active_drug_3, active_drug_4, active_drug_5, active_drug_6, active_drug_10, active_drug_11, active_drug_12, active_drug_13, active_drug_7, active_drug_8, active_drug_9, active_drug_14, p_description, radiological_r: string variables too long for .xpt format
Code:
foreach var of varlist active_drug_1 active_drug_2 active_drug_3 /// active_drug_4 active_drug_5 active_drug_6 active_drug_10 active_drug_11 /// active_drug_12 active_drug_13 active_drug_7 active_drug_8 active_drug_9 /// active_drug_14 p_description radiological_r { replace `var'=strltrim(`var') // No replacement replace `var'=strtrim(`var') // No replacement replace `var'=ustrtrim(`var') // No replacement replace `var'=subinstr(`var'," ","",.) // This command is executed but the error persists replace `var'="" // This command is also executed but the error persists as well }
Comment