<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Reading data in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Reading-data/m-p/718289#M222266</link>
    <description>&lt;P&gt;You might bother to actually state what is "wrong" in the output.&lt;/P&gt;
&lt;P&gt;If the issue is the presence or lack of a semicolon then you really in a lot of detail need to describe why "contrynew" in col1 does not have semicolon at the end but "xyzxybav;" does.&lt;/P&gt;
&lt;P&gt;Same with why "ab;charged;" and "ab;cd;dr;" are not split up but other values are.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Providing code that does not do what you want does not explain what the rules involved are.&lt;/P&gt;</description>
    <pubDate>Wed, 10 Feb 2021 16:09:17 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2021-02-10T16:09:17Z</dc:date>
    <item>
      <title>Reading data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-data/m-p/718281#M222261</link>
      <description>&lt;P&gt;Hi Reader,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is the data and code, facing issue while handelling semicolon and length , not getting correct output which is mentioned below in table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also I am not getting any error/warning in my program.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here, if length LE 10 then i want to consider semicolon (like col1-1st obs) as it is else ignore semicolon (like col1-2nd obs).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Output required-&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE style="width: 375px;" width="375"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="156"&gt;OLD&lt;/TD&gt;
&lt;TD width="74"&gt;COL&lt;/TD&gt;
&lt;TD width="81"&gt;COL1&lt;/TD&gt;
&lt;TD width="64"&gt;COL2&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;abcd;xyzxybav;charged;&lt;/TD&gt;
&lt;TD&gt;abcd;&lt;/TD&gt;
&lt;TD&gt;xyzxybav;&lt;/TD&gt;
&lt;TD&gt;charged;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;ab;countrynew;zcc;&lt;/TD&gt;
&lt;TD&gt;ab;&lt;/TD&gt;
&lt;TD&gt;countrynew&lt;/TD&gt;
&lt;TD&gt;zcc;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;ab;charged;&lt;/TD&gt;
&lt;TD&gt;ab;charged&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;ab;cd;dr;&lt;/TD&gt;
&lt;TD&gt;ab;cd;dr;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;ab&lt;/TD&gt;
&lt;TD&gt;ab&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data abc ;
old = "abcd;xyzxybav;charged;"; output;
old = "ab;countrynew;zcc;"; output;
old = "ab;charged;"; output;
old = "ab;cd;dr;"; output;
old = "ab"; output;
run;

%let w = 10 ;                                                                                             
     
data have  (drop = _:);
 set abc;                                                                                                                                                                                                                                               
 array c $ &amp;amp;w col col1-col2 ;
/*if old^="" and length(strip(old)) le &amp;amp;w then col=old; */
_i_ = 1 ;
do _x = 1 to countw (old, "; ") ;
c = catx ("; ", c, scan (old, _x, "; ")) ;
if length (c) &amp;lt;= &amp;amp;w and length (c) + length (scan (old, _x + 1)) &amp;gt; &amp;amp;w or _x = countw (old, "; ") then _i_ + 1 ;
end ;
run ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Feb 2021 17:41:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-data/m-p/718281#M222261</guid>
      <dc:creator>pdhokriya</dc:creator>
      <dc:date>2021-02-10T17:41:06Z</dc:date>
    </item>
    <item>
      <title>Re: Reading data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-data/m-p/718287#M222264</link>
      <description>&lt;P&gt;Are you getting ERRORs or WARNINGs in the log? If so, please show us the log (paste it into the window that appears when you click on the &amp;lt;/&amp;gt; icon)&lt;/P&gt;</description>
      <pubDate>Wed, 10 Feb 2021 16:08:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-data/m-p/718287#M222264</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-02-10T16:08:32Z</dc:date>
    </item>
    <item>
      <title>Re: Reading data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-data/m-p/718289#M222266</link>
      <description>&lt;P&gt;You might bother to actually state what is "wrong" in the output.&lt;/P&gt;
&lt;P&gt;If the issue is the presence or lack of a semicolon then you really in a lot of detail need to describe why "contrynew" in col1 does not have semicolon at the end but "xyzxybav;" does.&lt;/P&gt;
&lt;P&gt;Same with why "ab;charged;" and "ab;cd;dr;" are not split up but other values are.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Providing code that does not do what you want does not explain what the rules involved are.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Feb 2021 16:09:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-data/m-p/718289#M222266</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-02-10T16:09:17Z</dc:date>
    </item>
    <item>
      <title>Re: Reading data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-data/m-p/718302#M222274</link>
      <description>&lt;P&gt;please see code.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Feb 2021 16:30:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-data/m-p/718302#M222274</guid>
      <dc:creator>pdhokriya</dc:creator>
      <dc:date>2021-02-10T16:30:11Z</dc:date>
    </item>
    <item>
      <title>Re: Reading data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-data/m-p/718303#M222275</link>
      <description>&lt;P&gt;No error in pgrogram, just program need updation as per requirement.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Feb 2021 16:30:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-data/m-p/718303#M222275</guid>
      <dc:creator>pdhokriya</dc:creator>
      <dc:date>2021-02-10T16:30:56Z</dc:date>
    </item>
    <item>
      <title>Re: Reading data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-data/m-p/718309#M222280</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/55374"&gt;@pdhokriya&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;please see code.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Your code has col1-col9 but your sample data does not have col1-col9 so we can't really use your code or your data as it is.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I agree with&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;, please explain what is wrong instead of assuming that we can figure out what is wrong.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Feb 2021 16:37:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-data/m-p/718309#M222280</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-02-10T16:37:17Z</dc:date>
    </item>
    <item>
      <title>Re: Reading data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-data/m-p/718315#M222284</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/55374"&gt;@pdhokriya&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;please see code.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I am not a mind reader.&lt;/P&gt;
&lt;P&gt;If the code does not do what you want then there is no way the code can tell me what you want or expect.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Feb 2021 17:10:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-data/m-p/718315#M222284</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-02-10T17:10:10Z</dc:date>
    </item>
    <item>
      <title>Re: Reading data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-data/m-p/718326#M222292</link>
      <description>&lt;P&gt;I have updated col1 -col2. please check the fyr.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;also the code which i have given is not working correctly as i am not getting correct output (mentioned in table) so what shall i change in provided code so that will get correct ( table ) output.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Feb 2021 17:44:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-data/m-p/718326#M222292</guid>
      <dc:creator>pdhokriya</dc:creator>
      <dc:date>2021-02-10T17:44:15Z</dc:date>
    </item>
    <item>
      <title>Re: Reading data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-data/m-p/718327#M222293</link>
      <description>&lt;P&gt;ok, please ignore my code, and please refer this-&lt;/P&gt;
&lt;PRE class="language-sas"&gt;&lt;CODE&gt;data abc ;
old = "abcd;xyzxybav;charged;"; output;
old = "ab;countrynew;zcc;"; output;
old = "ab;charged;"; output;
old = "ab;cd;dr;"; output;
old = "ab"; output;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;and let me know how shall i get an output data.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Feb 2021 17:46:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-data/m-p/718327#M222293</guid>
      <dc:creator>pdhokriya</dc:creator>
      <dc:date>2021-02-10T17:46:17Z</dc:date>
    </item>
    <item>
      <title>Re: Reading data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-data/m-p/718334#M222299</link>
      <description>&lt;P&gt;This creates your intended result:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data abc ;
old = "abcd;xyzxybav;charged;"; output;
old = "ab;countrynew;zcc;"; output;
old = "ab;charged;"; output;
old = "ab;cd;dr;"; output;
old = "ab"; output;
run;

%let w = 10;

data want;
set abc;
length col col1 col2 $&amp;amp;w.;
if length (old) gt &amp;amp;w. + 1
then do;
  col = scan(old,1,";") !! ";";
  col1 = scan(old,2,";") !! ";";
  col2 = scan(old,3,";") !! ";";
end;
else col = old;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 10 Feb 2021 17:58:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-data/m-p/718334#M222299</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-02-10T17:58:28Z</dc:date>
    </item>
    <item>
      <title>Re: Reading data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-data/m-p/718337#M222302</link>
      <description>&lt;P&gt;You really seem to be having trouble explaining what you want.&amp;nbsp; From the example data step you posted a PROC PRINT will produce this report.&lt;/P&gt;
&lt;PRE&gt;Obs    old

 1     abcd;xyzxybav;charged;
 2     ab;countrynew;zcc;
 3     ab;charged;
 4     ab;cd;dr;
 5     ab
&lt;/PRE&gt;
&lt;P&gt;Now if you want to convert those strings into multiple values by splitting on the semi-colons then you could use something like this.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data tall;
  row+1;
  set abc ;
  length new $20;
  do item=1 by 1 until(new=' ');
    new=scan(old,item,';');
    if item=1 or new ne ' ' then output;
  end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Which will produce data like this:&lt;/P&gt;
&lt;PRE&gt;Obs    row    old                       new           item

  1     1     abcd;xyzxybav;charged;    abcd            1
  2     1     abcd;xyzxybav;charged;    xyzxybav        2
  3     1     abcd;xyzxybav;charged;    charged         3
  4     2     ab;countrynew;zcc;        ab              1
  5     2     ab;countrynew;zcc;        countrynew      2
  6     2     ab;countrynew;zcc;        zcc             3
  7     3     ab;charged;               ab              1
  8     3     ab;charged;               charged         2
  9     4     ab;cd;dr;                 ab              1
 10     4     ab;cd;dr;                 cd              2
 11     4     ab;cd;dr;                 dr              3
 12     5     ab                        ab              1&lt;/PRE&gt;
&lt;P&gt;Which you could transform back into one observation per original ROW by using PROC TRANSPOSE.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc transpose data=tall out=want(drop=_name_) prefix=col;
  by row ;
  id item;
  var new ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Result&lt;/P&gt;
&lt;PRE&gt;Obs    row    col1    col2          col3

 1      1     abcd    xyzxybav      charged
 2      2     ab      countrynew    zcc
 3      3     ab      charged
 4      4     ab      cd            dr
 5      5     ab
&lt;/PRE&gt;
&lt;P&gt;If this is NOT what you want then please describe in detail how what you want is different. And what are the rules that explain how to get what you want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Feb 2021 17:59:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-data/m-p/718337#M222302</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-02-10T17:59:59Z</dc:date>
    </item>
    <item>
      <title>Re: Reading data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-data/m-p/718474#M222362</link>
      <description>Ya You understood correctly, but may be something is missing.&lt;BR /&gt;and Yes I can elaborate more on this , for example , if i take below mentioned data and &amp;amp;w = 200 then &lt;BR /&gt;&lt;BR /&gt;data abc ;&lt;BR /&gt;old = "ASCORBIC ACID;CALCIUM CARBONATE;CALCIUM PHOSPHATE;CHROMIUM;CYANOCOBALAMIN;FOLIC ACID;MAGNESIUM CARBONATE;MAGNESIUM HYDROXIDE;MANGANESE;NICOTINIC ACID;PANTOTHENIC ACID;POTASSIUM BICARBONATE;POTASSIUM CARBONATE;POTASSIUM PHOSPHATE DIBASIC;PYRIDOXINE;QUERCETIN;RIBOFLAVIN;SODIUM BICARBONATE;SODIUM PHOSPHATE;THIAMINE;THIOCTIC ACID;ZINC ASCORBATE"; output;&lt;BR /&gt;&lt;BR /&gt;old = "ASCORBIC ACID;BIOTIN;CALCIUM;CALCIUM PHOSPHATE;CHROMIUM;CUPRIC OXIDE;CYANOCOBALAMIN;FOLIC ACID;IODINE;IRON;MAGNESIUM OXIDE;MANGANESE;MOLYBDENUM;NICKEL;NICOTINAMIDE;PANTOTHENIC ACID;PHYTOMENADIONE;POTASSIUM;PYRIDOXINE;RETINOL;RIBOFLAVIN;SELENIUM;SODIUM METASILICATE;THIAMINE;TOCOPHEROL;VITAMIN D NOS;ZINC"; output;&lt;BR /&gt;&lt;BR /&gt;old = "ab;countrynew;zcc;"; output;&lt;BR /&gt;old = "ab;charged;"; output;&lt;BR /&gt;old = "ab;cd;dr;"; output;&lt;BR /&gt;old = "ab"; output;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;output would be : &lt;BR /&gt;&lt;BR /&gt;example : obs = 1&lt;BR /&gt;&lt;BR /&gt;col = "ASCORBIC ACID;CALCIUM CARBONATE;CALCIUM PHOSPHATE;CHROMIUM;CYANOCOBALAMIN;FOLIC ACID;MAGNESIUM CARBONATE;MAGNESIUM HYDROXIDE;MANGANESE;NICOTINIC ACID;PANTOTHENIC ACID;POTASSIUM BICARBONATE;" &lt;BR /&gt;col1 = "POTASSIUM CARBONATE;POTASSIUM PHOSPHATE DIBASIC;PYRIDOXINE;QUERCETIN;RIBOFLAVIN;SODIUM BICARBONATE;SODIUM PHOSPHATE;THIAMINE;THIOCTIC ACID;ZINC ASCORBATE"&lt;BR /&gt;&lt;BR /&gt;example : obs = 2&lt;BR /&gt;&lt;BR /&gt;col= "ASCORBIC ACID;BIOTIN;CALCIUM;CALCIUM PHOSPHATE;CHROMIUM;CUPRIC OXIDE;CYANOCOBALAMIN;FOLIC ACID;IODINE;IRON;MAGNESIUM OXIDE;MANGANESE;MOLYBDENUM;NICKEL;NICOTINAMIDE;PANTOTHENIC ACID;PHYTOMENADIONE;"&lt;BR /&gt;col1= "POTASSIUM;PYRIDOXINE;RETINOL;RIBOFLAVIN;SELENIUM;SODIUM METASILICATE;THIAMINE;TOCOPHEROL;VITAMIN D NOS;ZINC"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 11 Feb 2021 04:37:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-data/m-p/718474#M222362</guid>
      <dc:creator>pdhokriya</dc:creator>
      <dc:date>2021-02-11T04:37:34Z</dc:date>
    </item>
    <item>
      <title>Re: Reading data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-data/m-p/718478#M222365</link>
      <description>&lt;P&gt;You are still missing the description of what you are trying to do.&lt;/P&gt;
&lt;P&gt;Let's make another guess.&amp;nbsp; You have a really long string of words delimited by semi-colon and you want to break it into smaller strings, but without splitting individual words.&amp;nbsp; So essentially you are doing word wrapping like a word processor would to flow a paragraph onto a page.&lt;/P&gt;
&lt;P&gt;So if the original string has a maximum length of 1000 and you want the new strings to each have a maximum length of 200 then you will probably need between a maximum of 5 to 10 of them to hold all of the possible words. (What would happen if every word was exactly 100 characters long?)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want ;
  set abc ;
  array col [10] $200 ;
  target=1;
  do source=1 to countw(old,';');
     if col[target]=' ' then col[target]=scan(old,source,';');
     else if 200 &amp;lt; length(catx(';',col[target],scan(old,source,';'))) then do;
       target=target+1;
       col[target]=scan(old,source,';');
     end;
     else col[target]=catx(';',col[target],scan(old,source,';'));
  end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or more simply generate the TALL structure instead. You can always add in a PROC TRANSPOSE step to convert it back into one observation with multiple columns.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data tall ;
  row+1;
  set abc ;
  length col 8 new $200;
  col=1;
  do source=1 to countw(old,';');
    if source&amp;gt;1 and vlength(new) &amp;lt; length(catx(';',new,scan(old,source,';'))) then do;
       output;
       col=col+1;
       new=' ';
    end;
    new=catx(';',new,scan(old,source,';'));
  end;
  if col=1 or new ne ' ' then output;
  drop source old;
run;

proc transpose data=tall out=want(drop=_name_) prefix=col;
  by row;
  id col;
  var new;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 11 Feb 2021 05:06:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-data/m-p/718478#M222365</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-02-11T05:06:29Z</dc:date>
    </item>
    <item>
      <title>Re: Reading data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-data/m-p/718503#M222378</link>
      <description>&lt;P&gt;Yes You are correct,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just 1 correction needed i.e. we cant ignore semicolon at the end which is a part of raw data. i.e.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;col:&amp;nbsp;ASCORBIC ACID;CALCIUM CARBONATE;CALCIUM PHOSPHATE;CHROMIUM;CYANOCOBALAMIN;FOLIC ACID;MAGNESIUM CARBONATE;MAGNESIUM HYDROXIDE;MANGANESE;NICOTINIC ACID;PANTOTHENIC ACID;POTASSIUM BICARBONATE&lt;FONT face="arial black,avant garde"&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;col:&amp;nbsp;ASCORBIC ACID;BIOTIN;CALCIUM;CALCIUM PHOSPHATE;CHROMIUM;CUPRIC OXIDE;CYANOCOBALAMIN;FOLIC ACID;IODINE;IRON;MAGNESIUM OXIDE;MANGANESE;MOLYBDENUM;NICKEL;NICOTINAMIDE;PANTOTHENIC ACID;PHYTOMENADIONE&lt;FONT face="arial black,avant garde" color="#FF0000"&gt;&lt;STRONG&gt;;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Feb 2021 08:28:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-data/m-p/718503#M222378</guid>
      <dc:creator>pdhokriya</dc:creator>
      <dc:date>2021-02-11T08:28:23Z</dc:date>
    </item>
    <item>
      <title>Re: Reading data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-data/m-p/719264#M222693</link>
      <description>&lt;BR /&gt;&lt;BR /&gt;Raw data is impacting in this code : &lt;BR /&gt;&lt;BR /&gt;data want ;&lt;BR /&gt;  set abc ;&lt;BR /&gt;  array col [10] $200 ;&lt;BR /&gt;  target=1;&lt;BR /&gt;  do source=1 to countw(old,';');&lt;BR /&gt;     if col[target]=' ' then col[target]=scan(old,source,';');&lt;BR /&gt;     else if 200 &amp;lt; length(catx(';',col[target],scan(old,source,';'))) then do;&lt;BR /&gt;       target=target+1;&lt;BR /&gt;       col[target]=scan(old,source,';');&lt;BR /&gt;     end;&lt;BR /&gt;     else col[target]=catx(';',col[target],scan(old,source,';'));&lt;BR /&gt;  end;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;: Could you please help me with this.</description>
      <pubDate>Mon, 15 Feb 2021 04:48:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-data/m-p/719264#M222693</guid>
      <dc:creator>pdhokriya</dc:creator>
      <dc:date>2021-02-15T04:48:47Z</dc:date>
    </item>
    <item>
      <title>Re: Reading data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-data/m-p/719269#M222696</link>
      <description>&lt;P&gt;Do you want to append the superfluous semi-colon to the end of every split value?&amp;nbsp; Or just the final one?&lt;/P&gt;
&lt;P&gt;Either way just use the CATS() function to add it back at the appropriate point in the logic.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Feb 2021 05:41:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-data/m-p/719269#M222696</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-02-15T05:41:07Z</dc:date>
    </item>
    <item>
      <title>Re: Reading data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-data/m-p/719532#M222803</link>
      <description>I do not want to additional semicolon.&lt;BR /&gt;&lt;BR /&gt;This issue was, raw data has semicolon but in output did not have semicolon as pe raw data.&lt;BR /&gt;&lt;BR /&gt;i.e. in col1 = data should be with semicolon as present in raw, but in final output did not present.&lt;BR /&gt;&lt;BR /&gt;****************************************************************************************&lt;BR /&gt;&lt;BR /&gt;data abc ;&lt;BR /&gt;old = "ASCORBIC ACID;CALCIUM CARBONATE;CALCIUM PHOSPHATE;CHROMIUM;CYANOCOBALAMIN;FOLIC ACID;MAGNESIUM CARBONATE;MAGNESIUM HYDROXIDE;MANGANESE;NICOTINIC ACID;PANTOTHENIC ACID;POTASSIUM BICARBONATE;POTASSIUM CARBONATE;POTASSIUM PHOSPHATE DIBASIC;PYRIDOXINE;QUERCETIN;RIBOFLAVIN;SODIUM BICARBONATE;SODIUM PHOSPHATE;THIAMINE;THIOCTIC ACID;ZINC ASCORBATE"; output;&lt;BR /&gt;&lt;BR /&gt;old = "ASCORBIC ACID;BIOTIN;CALCIUM;CALCIUM PHOSPHATE;CHROMIUM;CUPRIC OXIDE;CYANOCOBALAMIN;FOLIC ACID;IODINE;IRON;MAGNESIUM OXIDE;MANGANESE;MOLYBDENUM;NICKEL;NICOTINAMIDE;PANTOTHENIC ACID;PHYTOMENADIONE;POTASSIUM;PYRIDOXINE;RETINOL;RIBOFLAVIN;SELENIUM;SODIUM METASILICATE;THIAMINE;TOCOPHEROL;VITAMIN D NOS;ZINC"; output;&lt;BR /&gt;&lt;BR /&gt;old = "ab;countrynew;zcc;"; output;&lt;BR /&gt;old = "ab;charged;"; output;&lt;BR /&gt;old = "ab;cd;dr;"; output;&lt;BR /&gt;old = "ab"; output;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;data want ;&lt;BR /&gt;set abc ;&lt;BR /&gt;array col [10] $200 ;&lt;BR /&gt;target=1;&lt;BR /&gt;do source=1 to countw(old,';');&lt;BR /&gt;if col[target]=' ' then col[target]=scan(old,source,';');&lt;BR /&gt;else if 200 &amp;lt; length(catx(';',col[target],scan(old,source,';'))) then do;&lt;BR /&gt;target=target+1;&lt;BR /&gt;col[target]=scan(old,source,';');&lt;BR /&gt;end;&lt;BR /&gt;else col[target]=catx(';',col[target],scan(old,source,';'));&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;Current :ASCORBIC ACID;CALCIUM CARBONATE;CALCIUM PHOSPHATE;CHROMIUM;CYANOCOBALAMIN;FOLIC ACID;MAGNESIUM CARBONATE;MAGNESIUM HYDROXIDE;MANGANESE;NICOTINIC ACID;PANTOTHENIC ACID;POTASSIUM BICARBONATE&lt;BR /&gt;&lt;BR /&gt;Required (as present in raw) : ASCORBIC ACID;CALCIUM CARBONATE;CALCIUM PHOSPHATE;CHROMIUM;CYANOCOBALAMIN;FOLIC ACID;MAGNESIUM CARBONATE;MAGNESIUM HYDROXIDE;MANGANESE;NICOTINIC ACID;PANTOTHENIC ACID;POTASSIUM BICARBONATE;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 16 Feb 2021 05:24:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-data/m-p/719532#M222803</guid>
      <dc:creator>pdhokriya</dc:creator>
      <dc:date>2021-02-16T05:24:12Z</dc:date>
    </item>
    <item>
      <title>Re: Reading data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-data/m-p/719551#M222808</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/55374"&gt;@pdhokriya&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;I do not want to additional semicolon.&lt;BR /&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Your initial post does have trailing semicolons.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Feb 2021 08:45:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-data/m-p/719551#M222808</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-02-16T08:45:49Z</dc:date>
    </item>
    <item>
      <title>Re: Reading data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-data/m-p/719583#M222830</link>
      <description>Yes, but if semicolon is at 201 position than not required . but if semicolon is placed below 200 (after splitting) than I will required in the output (as per raw).</description>
      <pubDate>Tue, 16 Feb 2021 10:38:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-data/m-p/719583#M222830</guid>
      <dc:creator>pdhokriya</dc:creator>
      <dc:date>2021-02-16T10:38:13Z</dc:date>
    </item>
  </channel>
</rss>

