Note that there are some explanatory texts on larger screens.

plurals
  1. POread specific words in a sas string
    primarykey
    data
    text
    <p>Given a column below, I was trying to separate contact, address,zip, phone, fax &amp; website address using sas 9.1</p> <p>column 1 : Company_address</p> <blockquote> <p>Contact:Sean Collins Address:6301 NW 5th Way Suite1700 Fort Lauderdale, FL 33309 Phone:(954) 689-3984 Fax:(954) 689-3985 <a href="http://www.aajtech.com" rel="nofollow">http://www.aajtech.com</a></p> </blockquote> <p>output should be something like this</p> <pre><code>column 2 : Contact - Sean Collins column 3 : address - 6301 NW 5th Way Suite1700 Fort Lauderdale, FL column 4 : zip - 33309 column 5 : phone - (954) 689-3984 column 6 : fax - (954) 689-3985 column 7 : website - http://www.aajtech.com </code></pre> <p>This is what I was trying.</p> <pre><code>proc sort data=Ex2 out=Ex3 nodup dupout=b_out; by city; run; data Final; set Ex2; a=find(Company_Address,"http"); website=substr(Company_Address,a,50); b=find(Company_Address,"Phone:"); phone=substr(Company_Address,b,21); c=find(Company_Address,"Fax"); Fax=substr(Company_Address,c,19); Add=substr(Company_Address,1,b-1); Z=find(Add,"http"); Address=substr(Add,1,z-1); if Address=website then Address=" "; drop a b c z Add; run; </code></pre> <p>some help to figure this out is greatly appreciated.</p> <p>Note : The question posted here is not part of my job/work, Im a newbie trying to figure out things(these r my own scenarios), reason being curiosity.. The syntax worked out to some extent, however the program is not able to differentiate between company name and contact name thanks.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload