BookmarkSubscribeRSS Feed
qmshjwhx
Calcite | Level 5
Hi there,

I met a very weird situation and found a newly created SAS data set cannot open.

It happened when I created a data set B based on A after some modification. Then I

turned off the SAS session but latter I found B cannot be opened by SAS 9.2. B is

permanent and I know where it is. And it was so strange that, on the other hand, I was

able to view it using universal viewer. Does anyone know what cause this and how to

solve it?

Thanks everyone~

^-^
12 REPLIES 12
Doc_Duke
Rhodochrosite | Level 12
call tech support.
Sandhya
Fluorite | Level 6
Hi,

Does any of the variable in the dataset is linked to any user defined format? If so run the PROC FORMAT which defines the formats and then open it. It will open.

Regardz,
Sandhya.
qmshjwhx
Calcite | Level 5
Thank you a lot!! Sandhya, yeah, the problem is I used proc format to define some formats when I revised the data set. As you suggest, now it opens once i run the proc format again!!

Another question follows: it seems like the proc format could bring potential problem if I want to share the data with my colleagues especially when they don't know how I defined the user-defined format. But I like proc format personally because it does help a lot for analysis or creating report. So any suggestions about when this proc format should be used?

Again, thanks for solving my problem 🙂
Sandhya
Fluorite | Level 6
Hi,

Instead of attaching the format to the dataset, you can create a variable with the format.

Eg:

data one;
input id flag;
cards
0001 1
0002 0
0003 1
0004 1
0005 0
;
run;

proc format;
value flagvar 0 = 'Absent'
1 = 'Present';
run;

Instead of doing the following

data two;
set one;
format flag flagvar.;
run;

Why not do this

data two;
set one;
flag1 = put(flag, flagvar.);
run;

This way the values are created with the formatted values.

There are more advanced way of dealing with it, like attaching some format catalogs and so on. But, I prefer this. Less hassle.

Regardz,
Sandhya.
qmshjwhx
Calcite | Level 5
Hi, Sandhya, I tried your code and I think it is a more efficient way of dealing with format as well as avoiding potential format error.

Thank you so much!!
Vasile01
Fluorite | Level 6
Hi,

About the storage and retrieving user-defined format you could read from:
http://support.sas.com/kb/37/332.html

It will be a good practice to create some documentation about the user-defined format and then you could share with all those using that format.

Warm regards,
Vasile
Peter_C
Rhodochrosite | Level 12
Just as the universal viewer can read the data, so can SAS, if you prepare with
option NOfmterr ;
(no format errors)
before using the data set

It just presents the internal value in the default format for numbers or strings.
qmshjwhx
Calcite | Level 5
Wow, I think this is the easiest way~~

Thank you~
qmshjwhx
Calcite | Level 5
Hi Vasile01, I read this note and It did helped me to understand the storage and user-defined format. Perhaps I could try to build some format catalogs to store my defined format somewhere separately from my coding.

Thanks a lot for the useful information!!
harishpl02
Fluorite | Level 6
Thanks it worked.
GenDemo
Quartz | Level 8

Hi ... I am having a related problem.

 

I recently switched from base SAS to EG, so still very new to the way if works.

 

I am busy rebuilding my scripts in EG, so I have a process flow of various programs and tables that feed into one another. After a timely excersice where macro variables didn't transfer (I didn't know you could/had to define them as global), I got a part of my script working, but now I have a problem where the logs states my table 'work.loans' were created with 63 089 rows and 8 columns, and the data table icon appears in the process flow with the name 'loans' . However, the subsequent scripts say table 'loans' does not exist, and when I double click on the 'loans' table icon, EG says "WORK.LOANS does not exist. You will need to refresh the task". But the table does not show on the left under the work library.

 

I am doing something really idiotic? I've never had this type of problem in base SAS.

 

 

I'd appreciate some advice....I'll continue googling the problem.

 

 

GD

GenDemo
Quartz | Level 8
Ok...figured out that it has to do with the 'Allow parallel execution on the same server'. If you swtich that off, the problem goes away. Possible to do with the way EG handles the different sessions. Pity you can't have the parallel execution like on SQL SSRS.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 12 replies
  • 18476 views
  • 2 likes
  • 7 in conversation