问题
I'm not sure how to use proc datasets statement. Here is the error and code attached as a picture.
I just don't know what it wants when it says error 22-322 expecting a name. A simple example or solution would be great thanks.
回答1:
There are several issues with your syntax:
- Proc datasets expects a library name, but you've given it a dataset name. Try using
library = work;. - In conjunction with the above, you need to add the line
modify passengers;before the format statement so that proc datasets knows which dataset to modify. Otherwise, it will run without errors, but it won't apply the format. - You need a
quit;after therun;when usingproc datasets, as mentioned in your log output. This is because a proc datasets call can contain multiplerun;groups, so you need to indicate that you've got to the last one.
You also have the option to put the format statement somewhere else, which would avoid having to use proc datasets at all:
- The data step where you're creating
work.passengers, or - The
proc printwhere you're viewing it, if you don't want to apply the format permanently.
来源:https://stackoverflow.com/questions/26570713/proc-data-sets-argument-error-error-22-322-expecting-a-name