BookmarkSubscribeRSS Feed
Devindra
Calcite | Level 5

Hi,


I followed this code here, with slight modification to switch from csv to xlsx: https://documentation.sas.com/?docsetId=mcrolref&docsetTarget=n0ctmldxf23ixtn1kqsoh5bsgmg8.htm&docse...

 

which allowed me to import all the files in my directory into SAS.

 

 

What I would like to do now is to only import unique xlsx files moving forward, how would I go about doing this? 

6 REPLIES 6
VDD
Ammonite | Level 13 VDD
Ammonite | Level 13

create either a table, an array or something that can be IDed for the lookup and loop through your importing process.

Devindra
Calcite | Level 5
Sorry, how would I go about doing that?
Tom
Super User Tom
Super User

What do you mean UNIQUE.  How can you have two different XLSX files with the same name?

Devindra
Calcite | Level 5

To import new files, and not files that have already been imported. One table would consist a list of files that were already imported. then a new table would populate a list of files currently in my directory, and then it would compare the two tables, and then import the files the new files that appear.

 

 

SASKiwi
PROC Star

One simple way to do this would be to move already-imported spreadsheets manually to an archive folder. Trying to do this automatically is a lot harder because then you have the problem of import failures and having to repeat imports.

VDD
Ammonite | Level 13 VDD
Ammonite | Level 13

this simple question (road block) @Devindra  is what we all have to deal with.  It is part of the requirements and development process that takes somewhere around 90-95% of our time before we start coding.

 

You did not explain what you fully needed with all of the details about the time series nor the comparing of data results over time.

please be as specific as possible in your needs, so that those replying have the details they need to understand the problem you are facing.

 

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 6 replies
  • 677 views
  • 0 likes
  • 4 in conversation