<?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: create a dataset from a separated list in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/create-a-dataset-from-a-separated-list/m-p/24312#M4080</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your solution in your last post is shorter and works also.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I have to take in account the input format can change.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let CtxFormat="CtxName;CtxValue";&lt;/P&gt;&lt;P&gt;%let Ctx = "LotId;P110123; DuploWaferId;D02; Operation; 1000-OxideDepostion!1!0";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now it is simple, but it has to work also for:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let CtxFormat="CtxName;CtxEdit;CtxValue";&lt;/P&gt;&lt;P&gt;%let Ctx = "LotId;P110123;No; DuploWaferId;D02;Yes; Operation; 1000-OxideDepostion!1!0;Yes";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So with the CtxEdit no/Yes I will have to do something else.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With ctxName and ctxValue I will have to save them in the end. So I can not really hardcode it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have to find the place of CtxName and CtxValue in the format so I can use that place to find the same value in Ctx.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is not so straight forward that place 1 will be always name and place 2 will be value&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 06 Oct 2011 05:53:28 GMT</pubDate>
    <dc:creator>Filipvdr</dc:creator>
    <dc:date>2011-10-06T05:53:28Z</dc:date>
    <item>
      <title>create a dataset from a separated list</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-a-dataset-from-a-separated-list/m-p/24306#M4074</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;%let Ctx = "LotId;P110123; DuploWaferId;D02; Operation; 1000-OxideDepostion!1!0";&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this example this are always pairs. I want a table with columns LotId DuploWaferId Operation with the correct values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried already a few things, but what is the best way?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let CtxFormat="CtxName;CtxValue";&lt;BR /&gt;%let Ctx = "LotId;P110123; DuploWaferId;D02; Operation; 1000-OxideDepostion!1!0";&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;aantal = %sysfunc(countw(&amp;amp;CtxFormat,';'));&lt;BR /&gt;call symputx('aantal',aantal);&lt;BR /&gt;run;&lt;BR /&gt;%put &amp;amp;aantal;&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;aantal = %sysfunc(countw(&amp;amp;Ctx,';'));&lt;BR /&gt;call symputx('aantalvar',aantal);&lt;BR /&gt;run;&lt;BR /&gt;%put &amp;amp;aantalvar;&lt;/P&gt;&lt;P&gt;data format;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; array format{&amp;amp;aantal} $20.;&lt;BR /&gt;i = 1;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; do while (scan(&amp;amp;CtxFormat,i,';') NE '');&lt;BR /&gt;format{i} = scan(&amp;amp;CtxFormat,i,';');&lt;BR /&gt;i = i +1;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data colnames(keep=vname);&lt;BR /&gt;&amp;nbsp; set format (obs=1) ;&lt;BR /&gt;&amp;nbsp; array n{*} _NUMERIC_ ;&lt;BR /&gt;&amp;nbsp; array c{*} _CHARACTER_ ;&lt;BR /&gt;&amp;nbsp; do i = 1 to dim(n) ;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; vname = vname(n{i}) ;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; output ;&lt;BR /&gt;&amp;nbsp; end ;&lt;BR /&gt;&amp;nbsp; do i = 1 to dim(c) ;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; vname = vname(c{i}) ;&lt;BR /&gt;output;&lt;BR /&gt;&amp;nbsp; end ;&lt;BR /&gt;run ;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;select vname into:cols separated by ' ' from colnames where vname ne 'i';&lt;BR /&gt;quit;&lt;BR /&gt;%put &amp;amp;cols;&lt;/P&gt;&lt;P&gt;proc transpose data=format out=formattransp(keep=format1) prefix=format;&lt;BR /&gt;var &amp;amp;cols;&lt;BR /&gt;by i;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;set formattransp;&lt;BR /&gt;if upcase(format1) = "CTXNAME" then call symputx('PlaceName',_N_);&lt;BR /&gt;if upcase(format1) = "CTXVALUE" then call symputx('PlaceValue',_N_);&lt;BR /&gt;run;&lt;BR /&gt;%put &amp;amp;PlaceName &amp;amp;PlaceValue;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;/* read values */&lt;BR /&gt;/* aantal = number of blocks per variable */&lt;BR /&gt;/* aantalvar = number of variables in ctx */ &lt;BR /&gt;/* PlaceName = Place of the name of the variable */&lt;BR /&gt;/* PlaceValue = Place of the value of the variable */&lt;/P&gt;&lt;P&gt;data temp_variables;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; array format{&amp;amp;aantalvar} $50.;&lt;BR /&gt;i = 1;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; do while (scan(&amp;amp;Ctx,i,';') NE '');&lt;BR /&gt;format{i} = compress(scan(&amp;amp;Ctx,i,';'));&lt;BR /&gt;i = i +1;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data colnames(keep=vname);&lt;BR /&gt;&amp;nbsp; set temp_variables (obs=1) ;&lt;BR /&gt;&amp;nbsp; array n{*} _NUMERIC_ ;&lt;BR /&gt;&amp;nbsp; array c{*} _CHARACTER_ ;&lt;BR /&gt;&amp;nbsp; do i = 1 to dim(n) ;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; vname = vname(n{i}) ;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; output ;&lt;BR /&gt;&amp;nbsp; end ;&lt;BR /&gt;&amp;nbsp; do i = 1 to dim(c) ;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; vname = vname(c{i}) ;&lt;BR /&gt;output;&lt;BR /&gt;&amp;nbsp; end ;&lt;BR /&gt;run ;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;select vname into:cols separated by ' ' from colnames where vname ne 'i';&lt;BR /&gt;quit;&lt;BR /&gt;%put &amp;amp;cols;&lt;/P&gt;&lt;P&gt;proc transpose data=temp_variables out=temp_variables_transp(keep=format1) prefix=format;&lt;BR /&gt;var &amp;amp;cols;&lt;BR /&gt;by i;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data column_names(drop=teller) column_values(drop=teller);&lt;BR /&gt;set temp_variables_transp;&lt;BR /&gt;retain teller;&lt;BR /&gt;if _N_ = 1 then teller = 1;&lt;/P&gt;&lt;P&gt;if teller = &amp;amp;PlaceName then output column_names;&lt;BR /&gt;if teller = &amp;amp;PlaceValue then output column_values;&lt;/P&gt;&lt;P&gt;if mod(_N_,&amp;amp;aantal) = 0 then do;&lt;BR /&gt;&amp;nbsp; teller = 0;&lt;BR /&gt;end;&lt;BR /&gt;teller = teller + 1;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;select format1 into:columns separated by ' ' from column_names;&lt;BR /&gt;quit;&lt;BR /&gt;%put &amp;amp;columns;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Oct 2011 08:34:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-a-dataset-from-a-separated-list/m-p/24306#M4074</guid>
      <dc:creator>Filipvdr</dc:creator>
      <dc:date>2011-10-05T08:34:06Z</dc:date>
    </item>
    <item>
      <title>Re: create a dataset from a separated list</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-a-dataset-from-a-separated-list/m-p/24307#M4075</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you post the dataset you want to create? If i understood your request, you need something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" cellpadding="3" cellspacing="0" class="jiveBorder" height="47" style="border: 1px solid #000000; width: 481px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;LotId&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;DuploWaferId&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Operation&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;P110123&lt;/TD&gt;&lt;TD&gt;D02&lt;/TD&gt;&lt;TD&gt;1000-OxideDepostion!1!0&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="java" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Ctx = &amp;amp;g_Ctx;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; call execute('data work.Bill;');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; do i = 1 to (countc(Ctx, ';') + 1) by +2;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Left = strip(scan(Ctx, i, ';'));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Right = strip(scan(Ctx, i+1, ';'));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call execute(trim(Left) !! ' = "' !! trim(Right) !! '";');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; call execute('run;');&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;In this example this are always pairs&lt;/PRE&gt;&lt;P&gt;And what should happen, if this condition is not fulfilled.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Oct 2011 11:32:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-a-dataset-from-a-separated-list/m-p/24307#M4075</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2011-10-05T11:32:43Z</dc:date>
    </item>
    <item>
      <title>create a dataset from a separated list</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-a-dataset-from-a-separated-list/m-p/24308#M4076</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; hi, well I always need the Pair ctxName ctxValue, as you can see in my code i got this solved.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also i got the table i wanted (and yes it is the same as yours)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: green; font-family: 'Courier New'; background-color: white;"&gt;/* create a dataset for the edoc */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; column_names(drop=teller) column_values(drop=teller);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; temp_variables_transp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;retain&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; teller;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; _N_ = &lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt; &lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;then&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; teller = &lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; teller = &amp;amp;PlaceName &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;then&lt;/SPAN&gt; &lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;output&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; column_names;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; teller = &amp;amp;PlaceValue &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;then&lt;/SPAN&gt; &lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;output&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; column_values;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; mod(_N_,&amp;amp;aantal) = &lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;0&lt;/STRONG&gt; &lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;then&lt;/SPAN&gt; &lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;do&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; teller = &lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;0&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; teller = teller + &lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;sql&lt;/STRONG&gt;; &lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;select&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; format1 &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;into&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;:edoc_cols separated &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;by&lt;/SPAN&gt; &lt;SPAN style="font-size: 10pt; color: purple; font-family: 'Courier New'; background-color: white;"&gt;'#'&lt;/SPAN&gt; &lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;from&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; column_names; &lt;/SPAN&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;quit&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;sql&lt;/STRONG&gt;; &lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;select&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; format1 &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;into&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;:edoc_values separated &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;by&lt;/SPAN&gt; &lt;SPAN style="font-size: 10pt; color: purple; font-family: 'Courier New'; background-color: white;"&gt;'#'&lt;/SPAN&gt; &lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;from&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; column_values; &lt;/SPAN&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;quit&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;%put&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; &amp;amp;edoc_values;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;%put&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; &amp;amp;edoc_cols;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; edoc_temp_2;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; edoc_temp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; i = &lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;do&lt;/SPAN&gt; &lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;while&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; (scan(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: purple; font-family: 'Courier New'; background-color: white;"&gt;"&amp;amp;edoc_values"&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;,i,&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: purple; font-family: 'Courier New'; background-color: white;"&gt;'#'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;) NE &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: purple; font-family: 'Courier New'; background-color: white;"&gt;''&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; temp_var = compress(scan(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: purple; font-family: 'Courier New'; background-color: white;"&gt;"&amp;amp;edoc_cols"&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;,i,&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: purple; font-family: 'Courier New'; background-color: white;"&gt;'#'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; temp_val = compress(scan(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: purple; font-family: 'Courier New'; background-color: white;"&gt;"&amp;amp;edoc_values"&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;,i,&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: purple; font-family: 'Courier New'; background-color: white;"&gt;'#'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;output&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; i = i +&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;transpose&lt;/STRONG&gt; &lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;data&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;=edoc_temp_2 &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;out&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;=edoc_temp_3(drop=_NAME_);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="NL-BE" style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;var&lt;/SPAN&gt;&lt;SPAN lang="NL-BE" style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; temp_val;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="NL-BE" style="font-size: 10pt; color: blue; font-family: 'Courier New'; background-color: white;"&gt;id&lt;/SPAN&gt;&lt;SPAN lang="NL-BE" style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt; temp_var;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; color: black; font-family: 'Courier New'; background-color: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Oct 2011 11:47:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-a-dataset-from-a-separated-list/m-p/24308#M4076</guid>
      <dc:creator>Filipvdr</dc:creator>
      <dc:date>2011-10-05T11:47:24Z</dc:date>
    </item>
    <item>
      <title>Re: create a dataset from a separated list</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-a-dataset-from-a-separated-list/m-p/24309#M4077</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Still not sure what you want.&amp;nbsp; If you just want to split the string into variable/value pairs and create a dataset then you can use proc transpose to assign the variable names.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%let Ctx = "LotId;P110123; DuploWaferId;D02; Operation; 1000-OxideDepostion!1!0";&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;data vertical ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; length var $32 value $200;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; do _n_=1 by 2 until (var=' ');&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var = scan(&amp;amp;ctx,_n_,';','Q');&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; value = scan(&amp;amp;ctx,_n_+1,';','Q');&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if var ne ' ' then output;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; end;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;proc transpose data=vertical out=want(drop=_:) ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; id var;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; var value;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;proc print;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Duplo&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Obs&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LotId&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WaferId&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Operation&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; P110123&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; D02&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1000-OxideDepostion!1!0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Oct 2011 12:00:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-a-dataset-from-a-separated-list/m-p/24309#M4077</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2011-10-05T12:00:52Z</dc:date>
    </item>
    <item>
      <title>create a dataset from a separated list</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-a-dataset-from-a-separated-list/m-p/24310#M4078</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It will not be always Name Value&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It could be Value Name &lt;/P&gt;&lt;P&gt;or Name Value Other &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but he gives the format also in parameter (check first post) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but i solved it, thanks to all&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Oct 2011 12:12:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-a-dataset-from-a-separated-list/m-p/24310#M4078</guid>
      <dc:creator>Filipvdr</dc:creator>
      <dc:date>2011-10-05T12:12:21Z</dc:date>
    </item>
    <item>
      <title>Re: create a dataset from a separated list</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-a-dataset-from-a-separated-list/m-p/24311#M4079</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Glad it works, but that still looks very confusing. &lt;/P&gt;&lt;P&gt;You seem to have values in rows in a dataset that you convert to delimited strings that you then use to search for values in rows of another dataset.....&lt;/P&gt;&lt;P&gt;Can't you just merge the two datasets and stop using macro variables to pass data?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you post examples of the input and output?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Oct 2011 13:26:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-a-dataset-from-a-separated-list/m-p/24311#M4079</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2011-10-05T13:26:37Z</dc:date>
    </item>
    <item>
      <title>Re: create a dataset from a separated list</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-a-dataset-from-a-separated-list/m-p/24312#M4080</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your solution in your last post is shorter and works also.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I have to take in account the input format can change.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let CtxFormat="CtxName;CtxValue";&lt;/P&gt;&lt;P&gt;%let Ctx = "LotId;P110123; DuploWaferId;D02; Operation; 1000-OxideDepostion!1!0";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now it is simple, but it has to work also for:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let CtxFormat="CtxName;CtxEdit;CtxValue";&lt;/P&gt;&lt;P&gt;%let Ctx = "LotId;P110123;No; DuploWaferId;D02;Yes; Operation; 1000-OxideDepostion!1!0;Yes";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So with the CtxEdit no/Yes I will have to do something else.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With ctxName and ctxValue I will have to save them in the end. So I can not really hardcode it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have to find the place of CtxName and CtxValue in the format so I can use that place to find the same value in Ctx.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is not so straight forward that place 1 will be always name and place 2 will be value&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Oct 2011 05:53:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-a-dataset-from-a-separated-list/m-p/24312#M4080</guid>
      <dc:creator>Filipvdr</dc:creator>
      <dc:date>2011-10-06T05:53:28Z</dc:date>
    </item>
  </channel>
</rss>

