BookmarkSubscribeRSS Feed
shellp55
Quartz | Level 8

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.

2 REPLIES 2
Abud
Calcite | Level 5

Try to put the quotes between the file's name.

infile ZIPFILE("test.txt") truncover LRECL = 5000 firstobs=2;

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 1987 views
  • 0 likes
  • 3 in conversation