- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi All..
SAS getting automatically closed when i run this bellow code..
Is this a bug???Any IDEA???
Proc Format;
value xyz
1="Yes"
2="NO";
run;
Now i supposed to add one more value to this format for the value 3.
i am writing code like this..
Proc Format;
value xyz
3="Don't know"
other=[xyz.];
run;
Actually in above code i have to specify new format name,but i forgot and i did't get any error too.
Now i am applying this format to a dataset;
data a;
input x;
format x xyz.;
cards;
1
2
3
;
run;
i really wondered after running above code ,because SAS getting Closed automatically.i tried this for couple of times but same result.
Why this is happening???
Any Idea about this????
Thanks &Regards..
Sanjeev.K
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I ran the code below (your code, with a very small modification -- in bold) and in worked.
Proc Format;
value xyz
1="Yes"
2="No"
;
quit;
proc format;
value abc 3="Don't know"
other = [xyz.]
;
quit;
data a;
input x;
format x abc.;
cards;
1
2
3
;
run;
Can you give more details about what SAS version you are using?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi..
Thanks For your response..
Am using SAS 9.2 version now
and coming to your code modification,
i mentioned in my post as "Actually in above code i have to specify new format name,but i forgot and i did't get any error too".
so I too changed format name and it worked perfectly.
But my question is why SAS getting closed when i run previous code.????
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
When I ran your original code it did not close SAS.
Not sure what may have been the issue.
Glad it's working now; but it would be good to know what caused SAS to behave this way.
Best of luck!
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Which Version are you using..???
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I am using 9.3.
But my coworker just ran it on 9.2 and it closed.
Weird.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
The original program had a recursive format definition ... to look up a value in the XYZ format, look for "3" and if it's not there then look in the XYZ format. That this situation closed SAS looks like a bug that was fixed in 9.3. I would expect that 9.3 gives you some sort of related message when you try the original code.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
You are correct, Astounding.
This is the error from SAS(9.3):
ERROR: XYZ is given as a format-as-label within the format of the same name. This would cause
recursion and is not allowed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I did, right before you posted.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
my browser did't get refreshed...:-)
any way thank you..
Regards..
Sanjeev.K