An excel file - 'ABC.xlsx' already exists in an external folder. Requirement is to save the same file in the same location but in sas7bdat format.
I dont want to use the PROC IMPORT process as it will be lengthy process.
Please guide how effectively this can be done in SAS for multiple files stored in different locations.
Thanks
Any %macro %mend that can involve this diversity and just punching in the different paths and filenames. Any suggestion if I want to proceed with that how the syntax need to be framed.
Example: Location 1 --> File1.xlsx, File2.csv, File3.xlsb
Location 2 --> File4.csv
Location 3 --> File5.xlsx
Any best way wherein I can automate this in terms of importing them in SAS.
Hi @San_rise ,
For your high-level requirements you could try the following high-level steps:
For each .xlsx file location:
Kind regards,
Amir.
Any %macro %mend that can involve this diversity and just punching in the different paths and filenames. Any suggestion if I want to proceed with that how the syntax need to be framed.
Example: Location 1 --> File1.xlsx, File2.csv, File3.xlsb
Location 2 --> File4.csv
Location 3 --> File5.xlsx
Any best way wherein I can automate this in terms of importing them in SAS.
Hi @San_rise ,
Try considering the following method:
Kind regards,
Amir.
Thank you Amir. This does the work I was looking for.
Code dealing with multiple excel-files is hardly effective, caused by the nature of the excel-file-format. Convert all files to csv and - if they have the same structure - importing them is easy.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.