SAS Data Integration Studio, DataFlux Data Management Studio, SAS/ACCESS, SAS Data Loader for Hadoop and others

Trouble Reading sas7bpgm file

Reply
New Contributor
Posts: 4

Trouble Reading sas7bpgm file

Hello everyone,

 

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.

 

Thanks!

Super User
Super User
Posts: 9,465

Re: Trouble Reading sas7bpgm file

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.

New Contributor
Posts: 4

Re: Trouble Reading sas7bpgm file

Hi,

 

Thank you for your input. I am using a 32 bit SAS. I try to use procs you suggested as I don't have access to the source.

 

Thanks,

Amin

Super User
Posts: 9,941

Re: Trouble Reading sas7bpgm file

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).

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
New Contributor
Posts: 4

Re: Trouble Reading sas7bpgm file

Posted in reply to KurtBremser

Thank you. I try to open the file using hexdit.

 

Thanks

Super User
Posts: 13,365

Re: Trouble Reading sas7bpgm file

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.

 

 

New Contributor
Posts: 4

Re: Trouble Reading sas7bpgm file

Hello Everyone,

 

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.

 

Thanks

 

Super User
Posts: 3,871

Re: Trouble Reading sas7bpgm file

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? 

Ask a Question
Discussion stats
  • 7 replies
  • 208 views
  • 0 likes
  • 5 in conversation