Hi,
I am doing a many-to-one merge of two data sets. one is the source data set and the other has two variables; id to merge on and the other one 'Date' which is in below format in excel sheet;
21/07/2017
Null
08/02/2018
Null
So when I am merging the two data sets, the values I am seeing in the merged set for 'Date' are like;
42937
Null
42971
Null
Can someone help with writing the right code please?
Thanks
@sks521 wrote:
Thanks but how to save multiple worksheets as csv?
File - Save as, as usual. If you are concerned about the workload, just take into account the troubles you have right now.
A sustainable data handling process needs to keep Excel files out of the loop completely.
SAS log is also giving me this message;
'One or more variables were converted because the data type is not supported by the V9
engine. For more details, run with options MSGLEVEL=I.'
Thanks
Sarwat
Thanks, where should I use this command, in merging syntax?
And if I use it in the proc import step, I get this error message;
NOTE: VARCHAR data type is not supported by the V9 engine. Variable DateIntStarted has been
converted to CHAR data type.
ERROR: You are trying to use the numeric format DDMMYY with the character variable
DateIntStarted in data set WORK.GPDATA.
Start by getting rid of Excel files as a data source. Save the spreadsheets as csv files and read those with data steps; this will give you control over the whole process, so you can properly set variable attributes.
While fixing your process this way, you should post your merge code and the log from it. Posting example data in data steps with datalines will also be helpful.
Thanks but how to save multiple worksheets as csv?
So now I have created separate csv for each excel worksheet, imported them into SAS and merging went fine with one date variable having both var and char formats in one. I hope I am on the right track!
Thanks for all your help.
@sks521 wrote:
Thanks but how to save multiple worksheets as csv?
File - Save as, as usual. If you are concerned about the workload, just take into account the troubles you have right now.
A sustainable data handling process needs to keep Excel files out of the loop completely.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.