BookmarkSubscribeRSS Feed
apourmo
Calcite | Level 5

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!

7 REPLIES 7
RW9
Diamond | Level 26 RW9
Diamond | Level 26

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.

apourmo
Calcite | Level 5

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

Kurt_Bremser
Super User

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

apourmo
Calcite | Level 5

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

 

Thanks

ballardw
Super User

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.

 

 

apourmo
Calcite | Level 5

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

 

SASKiwi
PROC Star

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? 

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!

How to connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 7 replies
  • 1028 views
  • 0 likes
  • 5 in conversation