- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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~
^-^
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thank you so much!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
option NOfmterr ;
(no format errors)
before using the data set
It just presents the internal value in the default format for numbers or strings.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thank you~
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thanks a lot for the useful information!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content