Can you write a code in Proc SQL in SAS where we have to add a new column named StudentName to Student table which can be blank
Can you provide a example scenario
Like what are the steps to do that in Proc SQL and how to write a code.
Can you write a code in Proc SQL in SAS where we have to add a new column named StudentName to Student table which can be blank
Can you provide a example scenario
Like what are the steps to do that in Proc SQL and how to write a code.
I have updated your question to include the code you provided in comments and the error message that I get when I run that code.
In future, when writing questions on StackOverflow, it is more helpful if you include the full code AND any error messages in your question, that way people can help point out the specific problem and help you understand better.
I must admit the SAS documentation for an entry-level user is not the easiest to follow and the specific page for
ALTER TABLEdoes not include any examples. However, I did find some here, in the SAS Docs:So let's look at one of those examples:
There's a bit more than you need here, but let's go through each component:
To update your code, you need to do a couple of things:
student nameso it has no spaces, you can do this using an underscorestudent_nameThe resulting log:
The problem you might now encounter is that SAS initialises all columns with a length of 8, so to specify a longer length, use
length=:If you've read this far and this has helped, please remember to bear in mind my tips about including more information in your question - you are far more likely to receive a good quality answer that way.