08-30-2012 10:47 PM
I received from a data vendor a bunch of data files with .bcp file extensions and a little application 'gzip'. They told me to unzip the files and rename them as .txt files before importing into SAS in the usual way.
After unzipping these .bcp files, however, I found out that they remain .bcp files. So I came up with a solution myself by opening those unzipped files with Notepad++ and Save Aa them as .txt files. For these files, I was able to import them all into SAS.
However, many of the unzipped files are too large to be clicked open in Notepad++, so I could not import them into SAS.
Could you please show me how to fix this issue? Each of the files are in several GBs and cannot be openned in Notepad++ or anything to save them as .txt files. I don't know how to read them into SAS.
Thanks so much
08-31-2012 03:49 AM
Although having a wrong extension, from what you're saying those files are compressed (zip).
Once decompressed you're good to go, no need to open them through anything else.
Seems you're just using Notepad++ to rename the extension. Unless Notepad++ is translating something in the process, say line feed/carriage return codes. Either way, I see no need to pass them through Notepad++, SAS will import them fine directly (after decompressed), as Ksharp suggestion.
If you care to bypass the unzip process outside SAS, you may try to pipe the unzip command from infile, like this:
infile 'unzip -p C:\INPUT\MYFILE.bcp' pipe; * -p option pipes the content;
NOTE: -p option of my unzip command line utility pipes the content of the zip, for winzip it's the -c option, you'll have to check the utility your using, and get the correct option flag.
Another way, would be to use SASZIPAM engine, which is a "use at your own risk" feature: http://support.sas.com/kb/31/244.html
But I wouldn't recommend it for big files like yours.
Cheers from Portugal.
Daniel Santos @ www.cgd.pt