Proc 数据集参数错误 - 需要名称的错误 22-322 [英] Proc Data sets argument error- Error 22-322 expecting a name

查看:52
本文介绍了Proc 数据集参数错误 - 需要名称的错误 22-322的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不确定如何使用 proc datasets 语句.这是作为图片附加的错误和代码.

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

当它说错误 22-322 需要一个名字时,我只是不知道它想要什么.一个简单的示例或解决方案将非常感谢.

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.

推荐答案

你的语法有几个问题:

  • Proc datasets 需要一个库名称,但您已经为其指定了一个数据集名称.尝试使用 library = work;.
  • 结合上面的内容,需要在format语句前加上modify Passenger;,这样proc datasets就知道要修改哪个数据集了.否则,它运行时不会出错,但不会应用格式.
  • 在使用 proc 数据集 时,在 run; 之后需要 quit;,如日志输出中所述.这是因为 proc datasets 调用可以包含多个 run; 组,因此您需要指出您已经到了最后一个.
  • 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.

您还可以选择将格式语句放在其他地方,这样可以完全避免使用 proc 数据集:

You also have the option to put the format statement somewhere else, which would avoid having to use proc datasets at all:

  • 您正在创建work.passengers 的数据步骤,或
  • proc print 您正在查看的位置,如果您不想永久应用格式.
  • 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.

这篇关于Proc 数据集参数错误 - 需要名称的错误 22-322的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆