i have a dataset in excel file , then how to write format length datatype
this type of variable
i want change this
So from the latest post is looks like.
1) You are using Enterprise Guide.
2) You are using the Import wizard of Enterprise Guide to read a file that is accessible of the machine where you are running Enterprise Guide (which could be a completely different machine that where the SAS code that Enterprise Guide generates runs).
3) You can an old style XLS file instead of a more modern XLSX file.
What the Enterprise Guide wizard has done is read in that XLS file on your Windows machine and converted it to a text file. It then uploaded that file and generated and run the data step you showed the log messages about.
Unfortunately I do not know if that Wizard has any way for you to tell it how to write the code to read the text file it generated. Or if has anything you can control to change how it generates the text file from the XLS file.
With normal SAS code there is very little you can do to control how PROC IMPORT will define the variables created from an XLS or XLSX file.
So most likely you will need to either:
1) Add an additional step after the "import" to make a new version of the file with the data types you want (note in SAS the word FORMAT means the way that a variable is DISPLAYED, not how it is STORED).
2) Add a step your PC to convert the sheet from the XLS file into a text file. Then upload that file to your SAS server and write your own data step to read it.
Please write more words, that explain the problem in detail, emphasis on "in detail", we don't want brevity.
You can just change the code used to read in the Excel file. SAS has provided you with this code.
So from the latest post is looks like.
1) You are using Enterprise Guide.
2) You are using the Import wizard of Enterprise Guide to read a file that is accessible of the machine where you are running Enterprise Guide (which could be a completely different machine that where the SAS code that Enterprise Guide generates runs).
3) You can an old style XLS file instead of a more modern XLSX file.
What the Enterprise Guide wizard has done is read in that XLS file on your Windows machine and converted it to a text file. It then uploaded that file and generated and run the data step you showed the log messages about.
Unfortunately I do not know if that Wizard has any way for you to tell it how to write the code to read the text file it generated. Or if has anything you can control to change how it generates the text file from the XLS file.
With normal SAS code there is very little you can do to control how PROC IMPORT will define the variables created from an XLS or XLSX file.
So most likely you will need to either:
1) Add an additional step after the "import" to make a new version of the file with the data types you want (note in SAS the word FORMAT means the way that a variable is DISPLAYED, not how it is STORED).
2) Add a step your PC to convert the sheet from the XLS file into a text file. Then upload that file to your SAS server and write your own data step to read it.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.