0
votes

I'm not sure how to use proc datasets statement. Here is the error and code attached as a picture. enter image description here

enter image description here

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
It will be easier for people to investigate your code if you post it as text. Don't worry about the colour highlighting.user667489

1 Answers

3
votes

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 the run; when using proc datasets, as mentioned in your log output. This is because a proc datasets call can contain multiple run; 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 print where you're viewing it, if you don't want to apply the format permanently.