SAS处理NPPES月度Zip数据时4-5月文件打开失败求助
Hey there, I’ve run into this exact issue before with NPPES data files—March works fine but April/May throw that open failure error, even when paths and filenames check out, and you can tell SAS sees the ZIP because missing CSV files trigger a different error. Here are the troubleshooting steps that fixed it for me and others:
Verify ZIP File Integrity
NPPES monthly files are often large, and partial downloads (thanks to flaky internet) are super common. Try manually opening the April/May ZIPs with a tool like WinZip or 7-Zip—if they won’t extract, that’s your problem right there. Re-download the files, preferably using a download manager to avoid interruptions.Check SAS Version Compatibility with ZIP Formats
Older SAS versions struggle with newer ZIP compression algorithms that CMS sometimes uses for larger monthly files. A quick test: manually extract the CSV from the ZIP to a local folder, then modify your code to read directly from that CSV (replaceinfile inzip(...)with the local CSV path). If that works, you’ve got a ZIP compatibility issue. Options here:- Upgrade to a newer SAS release (9.4M5+ handles modern ZIPs much better)
- Use a pre-processing step with a command-line tool like 7-Zip to extract the CSV before SAS runs, then point your code to the extracted file.
Shorten File Paths & Avoid Special Characters
Windows has a hidden 260-character path limit that trips up SAS all the time, even if you think your path is "short enough". Try moving the ZIP files to a super simple directory likeC:\NPI_Data\instead of nested folders, then update the&dirmacro variable in your code. Also, make sure there are no spaces, parentheses, or non-ASCII characters in the path or filename—SAS can get finicky with those when handling ZIPs.Run SAS with Admin Permissions
Sometimes SAS doesn’t have the right permissions to create temporary file handles for ZIP processing. Right-click your SAS shortcut and select Run as administrator, then re-run your code. Also double-check that your user account has read/write access to the folder where the ZIPs are stored (SAS needs to write temp files when reading from ZIPs).Double-Check the CSV Filename Inside the ZIP
Even though you said SAS recognizes the ZIP, it’s worth confirming that the CSV filename in your code matches exactly what’s inside each monthly ZIP. NPPES updates the CSV filename with the monthly cutoff date—for example, May 2018’s CSV isnpidata_pfile_20050523-20180513.csv, but April 2018’s will benpidata_pfile_20050523-20180412.csv. If you’re using the May filename for the April ZIP, that could cause unexpected errors (though usually it’s a "file not found" error, but better to rule it out!).
内容的提问来源于stack exchange,提问作者scify

