简体   繁体   English

sas 数据集中的问题

[英]Issue in sas data set

Right now I am having a column in sas data set.This dataset has been created in sas enterprie guide EG现在我在 sas 数据集中有一列。这个数据集是在 sas 企业指南 EG 中创建的

S.NO.  COUNT
1       5
2       6
3       7
4       2
5       10

Now the dataset that I desire.现在是我想要的数据集。

S.NO.  COUNT   MASKED
1       5      XXXXX
2       6      XXXXXX
3       7      XXXXXXX
4       2      XX
5       10     XXXXXXXXXX

Basically the number present in the count,I want that many 'x' in the 'MASKED' column.基本上是计数中存在的数字,我希望“MASKED”列中有那么多“x”。

Thank in advance.预先感谢。

In SAS proc SQL, try the repeat() function:在 SAS proc SQL 中,尝试repeat()函数:

select t.*, repeat('X', count)
from t;

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

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