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
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?
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.????
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!
Which Version are you using..???
I am using 9.3.
But my coworker just ran it on 9.2 and it closed.
Weird.
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.
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.
I did, right before you posted.
my browser did't get refreshed...:-)
any way thank you..
Regards..
Sanjeev.K
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.