Hi,
I have to compare folder name saved on server (e.g. 2013) with value in table (e.g. where year is 2013). If a match found then read all files from this folder.
My Idea is to to save a folder name in var1 and value from table in var2. If they are equal then go to next transformation.
The problem is i am very new to DI Studio and need some suggestion and right way to implement it?
Thanks in Advance and Best Regards
Dani
I'm not sure how to compare a name on a folder - don't you need to specify the name of the folder in some way first? Or do you mean that you want to if a folder with a specific name exists, if yes, then import all files?
I suggest some pre-code, or User written that searches for the folder with appropriate name, if exists, import the folder contents to SAS table. Then use the lopp transform that calls the job where you actually import the file, using the "folder" SAS table as input to parameterize the called job.
Or, if the files have identical structure, you may use aggregate filename technique.
I am using user written transformation where i save my folder name in a var1 and then giving the whole path in another var2 concat with this var1. At the end with a boolean value of var2 0 or 1 i can identify exist or not.
Thanks for answer.
So, it's not parameterized for the job, path and folder name are "hard coded" for each job that uses the transforamtion?
You use the dopen function, check the return code.
Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.
Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.
Find more tutorials on the SAS Users YouTube channel.