If you read by last post, I showed how one can download several files from a URL address. In this post, I will use macros to read the contents of the zip files downloaded earlier.
In order to do so, I made use of dopen function that opens a directory and returns a directory identifier value. If the directory contains no file, the program stops. A do loop is then used to loop through the directory identifier values starting from 1 and then it is passed to dread function that returns the name of the directory using an output statement. After all the iterations are over dclose function is used to close the directory. Proc print was used to view the name of files inside. This entire process was enclosed in a macro called insidezip and %DO loop was used to loop through each of the zip files and all their contents were read.
In case you are wondering where the files are coming from, just look at the six %Let Var statements in my earlier post! I am assigning the location of those files as:
%Let VAR2 = “C:\Users\adhikas\Desktop\GroupProject\IndividualProject\H1B_efile_FY02_text.zip” ;
.. .. .. .. ..
.. .. .. .. ..
%Let VAR_file = 7;
and so on..