Hello
I want to be able to have many text files in one password protected WinZip file. The format and structure of each of the files in the winzip file is exactly the same with, of course, different filenames.
The following code works for a single text file in a non-password protected zip file:
FILENAME ZIPFILE SASZIPAM 'C:\Temp\filename.zip';
data import;
infile ZIPFILE(test.txt) truncover LRECL = 5000 firstobs=2;
input @1 Prov $1.
@2 Inst $4.
@6 Fyear $4.
@10 Period $2.
@12 Batch $2.
@14 AbsNo $3.
@18 Coder $2.
@20 ChartNo $10.
@30 RegNo $7.
@37 SecChartNo $10.;
run;
When these files are in a folder, I can reference all at once by using the wildcard i.e. filename 'c:\Temp\*.txt' but I tried that in the code above and got the error message "Member *.txt does not exist". Is there a way to reference all at once? Also, how do I work the password into the code above?
Thanks for any and all assistance.
Try to put the quotes between the file's name.
infile ZIPFILE("test.txt") truncover LRECL = 5000 firstobs=2;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.