I want to modify the informat for a particular variable as an income variable is not showing properly. I was told this can be done through the log..ie modify it in the log. But I don't see the informats on there. Is there an option or something that it needed to show that?
What kind of file are you reading? Only for text-based files will proc import create a data step, which you can copy from the log and modify to your needs.
It is a .xlsx file.
If you are reading from an XLSX file then SAS will define the variables based on how the cells in the spreadsheet columns are defined. If the cells are of mixed type then the variable will be character, since you can always convert a number to a character representation but you cannot always do the opposite.
Is there some particular problem you are having?
It is a .xlsx file.
Export to a CSV file and then import that CSV. Then you will have the data step code in the LOG to read a csv file. You may want to use the GUESSINGROWS option to specify a large number of rows to examine before SAS sets the properties for the variables. Otherwise only 20 or so rows are used which is a frequent problem.
That code could be copied, pasted into the editor and edit the Informat and format statements.
I convert dozens of xlsx to csv files monthly to have control while reading the files because I can't trust my data sources not to change value codes, change column headings or change column order.
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.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.