08-14-2017 09:00 AM
I have a problem opening a sas7bpgm file which as I understand is a compiled data step program. I am trying to find the code contained in this file and I get an error. I appreciate it if anyone can help me how to find the code inside this file.
The code I run and the massage in log is:
37 data pgm=codes.cpscr1; 38 describe; 39 run; ERROR: The stored program CODES.CPSCR1 was created on an incompatible host and cannot execute on this host. ERROR: Unable to load DATA STEP program CODES.CPSCR1. NOTE: The SAS System stopped processing this step because of errors. NOTE: DATA statement used (Total process time): real time 0.01 seconds cpu time 0.01 seconds
I am using SAS 9.3 and the full file name is cpscr1.sas7bpgm.
08-14-2017 09:10 AM
I have never heard of this file type, however it is another example of why to never use proprietary file formats. As it is a binary file format you may have issues with it, for instance, it was likely compiled on a 32bit system, so you would need to read the catalog on a 32bit system. You may also need to use a combination of proc cimport or cport functions if the file was created on another system.
Unless I fancied wasting a few hours trying to get this running I would go back to source and ask them to provide open text files if possible, and take it as a hint, always use open cross platform file formats like text for ease of use.
08-14-2017 09:25 AM
That's a Stored Compiled Data Step Program.
Something that is rarely used because of the problems you just encounter. It's much better to store dynamic code in a macro in a .sas file.
You might be able to extract the code by opening the file with a hex viewing tool (ie hexdump or hexedit).
08-14-2017 10:56 AM
ERROR: The stored program CODES.CPSCR1 was created on an incompatible host and cannot execute
on this host.
Since this is a compiled file it is dependent on operating system and possibly version as well. That's the "incompatible host" bit.
You might also have problems with things refereenced in the code such as libraries you do not have, or data sets in libraries you do not have and that could be just a start.
08-18-2017 12:30 PM
I finally found the platform that seems be the one this file was compiled in. However i still have trouble realizing what's in it.
The code and the error message:
6 data pgm=code.cpscr1; 7 describe; 8 run; NOTE: No source statements were found in CODE.CPSCR1.PROGRAM. NOTE: DATA statement used (Total process time): real time 0.00 seconds cpu time 0.00 seconds
The file suffix is : sas7bpgm
Please let me know if you know any other way to decode this thing.
08-18-2017 10:06 PM
There is no error message in your log, just a note. It is entirely possible that there are genuinely no source statements in your program.
What happens if you execute the stored program on the platform where you ran the DESCRIBE?