简体   繁体   English

SAS存储过程用户输入列表

[英]SAS Stored Procedure User Enters List

Is it possible to created a Stored Procedure in SAS Enterprise Guide and allow the user to enter in a list of values, without having to manually enter in the list? 是否可以在SAS Enterprise Guide中创建存储过程并允许用户输入值列表,而不必手动输入列表?

I use more Base SAS than EG, so I'm not an expert on Stored Procedures. 我使用的基本SAS比EG多,因此我不是存储过程专家。 Currently, an analyst in my area may have to search for a list of values like so: 当前,我所在地区的分析师可能必须搜索值列表,如下所示:

012345678
123456789
231456789
091236574
439857345
120129038
230918239
....
....
N

and is using a Stored Procedure that was built to enter in these values. 并且正在使用为输入这些值而构建的存储过程。 However, this is not efficient as this last can be >40 values, and SAS will only allow you to enter in one at a time. 但是,这效率不高,因为最后一个值可以大于40,而SAS仅允许您一次输入一个。

I've been messing around with the prompt manager for an hour or so and haven't had any luck. 我已经和提示管理器搞混了一个小时左右,还没有运气。 I've also tried 'User selects from a static list', using an excel doc that I imported. 我还尝试了使用导入的Excel文档“用户从静态列表中进行选择”。 Which worked great ad-hoc, but, because the values will always be different, I can't figure out how to make EG first import this excel doc, then bring up the prompt for her to select all the (new) values, then run the rest of the program. 临时效果很好,但是因为值总是不同的,所以我不知道如何使EG首先导入此excel文档,然后提示她选择所有(新)值,然后运行程序的其余部分。

Also, it seems that I would have to change the 'Static Value List' in the prompt manager every time the doc was imported, even if the rest of the program was conditioned on the import of the excel doc. 另外,似乎每次导入文档时我都必须在提示管理器中更改“静态值列表”,即使程序的其余部分取决于excel文档的导入。 I'm going to continue playing around with this, but looking for ideas as to if anyone has done this previously. 我将继续处理此问题,但希望寻找有关以前是否有人这样做的想法。

Sounds like you want "select multiple values from a dynamic list". 听起来像您想要“从动态列表中选择多个值”。 I suggest you read the excel file that holds all the response options into a SAS dataset. 我建议您阅读将所有响应选项保存到SAS数据集中的excel文件。 Then register that dataset in the SAS metadata server. 然后在SAS元数据服务器中注册该数据集。 When you create a dynamic prompt you point to the source SAS dataset that holds the response options. 创建动态提示时,您指向保存响应选项的源SAS数据集。 After creating the prompt, you can update the dataset any time you want (add/delete records), and then STP user will see those updated response options in the prompts. 创建提示后,您可以随时更新数据集(添加/删除记录),然后STP用户将在提示中看到那些更新的响应选项。

It may also be possible to register an Excel file in metadata instead of reading it into a SAS dataset. 也可以在元数据中注册Excel文件,而不是将其读取到SAS数据集中。 But I always try to limit Excel usage as much as possible. 但是我总是尝试尽可能地限制Excel的使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM