I have an existing data step code to download a .sas7bdat table from http endpoint, and save it into the WORK library, and then read the data in it.
The code is like this:
filename cp_src filesrvc folderpath="/Public" name="hmeq_train.sas7bdat" recfm=N lrecl=32767;
* Save the table to work.hmeq_train;
filename cp_tgt "hmeq_train.sas7bdat" recfm=N lrecl=32767;
data _null_;
fcopy('cp_src','cp_tgt');
run;
proc print data=work.hmeq_train;
run;
But this is in single thread. I have tens of binary .sas7bdat files needs to be downloaded at the same. I noticed that DS2 can leverage multi-thread ability to run program concurrently. But I tried fcopy() or INFILE statement, they both don't work in DS2.
Is there a way to do the same thing in DS2?
Since you are using filesrvc method, it looks like your data are on your Viya server, is that right?
If those files located in a single directory?
If yes you could use PROC COPY to get data from one location to another:
libname a ".../Public";
proc copy in=A out=work;
run;
If those files are in multiple locations you can create "combined" library, and also use PROC COPY:
libname a (".../Public1" ".../Publuic2" ".../Public3");
proc copy in=A out=work;
run;
Bart
@Jonas_Jing - I think you have an IO issue with copying multiple files not a multi-threading restriction. I believe you could use SAS/CONNECT, which comes with Viya, and start several SAS sessions and simulaneously download multiple files that way.
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.