全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
1425 2
2017-07-24
please write a SAS program to separate the text below:

One meets its destiny on the road he takes to avoid it. Your mind is like this water, my friend, when it is agitated, it becomes difficult to see, but if you allow it to settle, the answer becomes clear. Yesterday is history Tomorrow is a mystery. But today is a gift. That is why it’s called the present (the gift). Hope is a good thing, maybe the best of things, and no good thing ever dies.

Require 1: the length of each fragment can’t exceed 50;
Require 2: the word can’t be truncated.
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2017-7-24 14:49:24
data wanted;
set text;
_text=text;
array txt[*] $50 text1-text10;
i=1;
do until(_text="");
loc1=anyspace(_text,-50);
loc2=anypunct(_text,-50);
loc=max(loc1,loc2);
if loc=0 then loc=50;
txt[i]=left(substr(_text,1,loc));
_text=strip(substr(_text,loc+1));
i+1;
end;
keep text:;
run;
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2017-7-24 15:54:26
wwang111 发表于 2017-7-24 14:49
data wanted;
set text;
_text=text;
非常感谢
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群