<?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: How to parse long value string in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-parse-long-value-string/m-p/127917#M1667</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you asking how to this in XML Map Studio?&lt;/P&gt;&lt;P&gt;I'm not very familiar with that, but once mapped, I guess you could parse these string using SAS programs, where there are a bunch of string functions at hand.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 06 Mar 2013 09:59:15 GMT</pubDate>
    <dc:creator>LinusH</dc:creator>
    <dc:date>2013-03-06T09:59:15Z</dc:date>
    <item>
      <title>How to parse long value string</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-parse-long-value-string/m-p/127916#M1666</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am attempting to get prompt information associated with a Stored Process by using Proc Metadata.&amp;nbsp; The output i get is an XML file of which is then used to create an XML Map with SAS XML Mapper.&lt;/P&gt;&lt;P&gt;One resulting variable/column has all the necessary information (see below), but the problem is the information is one long string and needs to be parsed, hence my question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can this be parsed from a single column into numerous columns?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have formatted the value string so the pattern can be deciphered.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"&amp;lt;PromptGroup promptId="PromptGroup_1362013200352_765533" version="1.0"&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;DefinitionsAndSubgroups&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;TextDefinition allowUserValues="false" hidden="true" name="Year" promptId="PromptDef_1361550692752_245256"&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;Label&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;Text xml:lang="en-US"&amp;gt;Select Year:&amp;lt;/Text&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/Label&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;DefaultValue&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;String value="2002"&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/String&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/DefaultValue&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;ValueProvider&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;PromptColumnValueProvider distinct="true" formatLabels="true" sortFirst="SortNone" tableUrl="URL::/User Folders/User/Data/MYTABLE1(Table)" threshold="1000"&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;LabelColumn&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;ColumnInfo format="-Default-" name="YEAR"&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/ColumnInfo&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/LabelColumn&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;ValueColumn&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;ColumnInfo name="YEAR"&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/ColumnInfo&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/ValueColumn&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/PromptColumnValueProvider&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/ValueProvider&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/TextDefinition&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;TextDefinition allowUserValues="false" hidden="true" name="Location" promptId="PromptDef_1362503931112_781477"&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;Label&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;Text xml:lang="en-US"&amp;gt;Select Location:&amp;lt;/Text&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/Label&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;DefaultValue&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;String value="My Location"&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/String&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/DefaultValue&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;ValueProvider&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;PromptColumnValueProvider distinct="true" formatLabels="true" sortFirst="SortNone" tableUrl="URL::/User Folders/User/Data/MYTABLE2(Table)" threshold="1000"&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;LabelColumn&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;ColumnInfo format="-Default-" name="LOCATION"&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/ColumnInfo&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/LabelColumn&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;ValueColumn&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;ColumnInfo name="LOCATION"&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/ColumnInfo&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/ValueColumn&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/PromptColumnValueProvider&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/ValueProvider&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/TextDefinition&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/DefinitionsAndSubgroups&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;Label&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;Text xml:lang="en-US"&amp;gt;Parameters&amp;lt;/Text&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/Label&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/PromptGroup&amp;gt;"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Mar 2013 19:24:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-parse-long-value-string/m-p/127916#M1666</guid>
      <dc:creator>Chuy</dc:creator>
      <dc:date>2013-03-05T19:24:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to parse long value string</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-parse-long-value-string/m-p/127917#M1667</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you asking how to this in XML Map Studio?&lt;/P&gt;&lt;P&gt;I'm not very familiar with that, but once mapped, I guess you could parse these string using SAS programs, where there are a bunch of string functions at hand.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Mar 2013 09:59:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-parse-long-value-string/m-p/127917#M1667</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2013-03-06T09:59:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to parse long value string</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-parse-long-value-string/m-p/127918#M1668</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The only value that looks like it might need to be parsed is: &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt; promptId="PromptDef_1361550692752_245256"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;If you have done the XML map properly then this value should be available. You can use the SCAN() function in a data step to parse it.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;libname xml xml ..... ;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set xml.have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; length PromptID1-PromptID3 $20;&lt;/P&gt;&lt;P&gt;&amp;nbsp; promptid1 = scan(promptid,1,'_');&lt;/P&gt;&lt;P&gt;&amp;nbsp; promptid2 = scan(promptid,2,'_');&lt;/P&gt;&lt;P&gt;&amp;nbsp; promptid3 = scan(promptid,3,'_');&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Mar 2013 15:32:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-parse-long-value-string/m-p/127918#M1668</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-03-06T15:32:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to parse long value string</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-parse-long-value-string/m-p/127919#M1669</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've resolved this by writing out the column to an XML file in a data step and creating another XML map then using the XML Engine to read it in.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Mar 2013 16:29:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-parse-long-value-string/m-p/127919#M1669</guid>
      <dc:creator>Chuy</dc:creator>
      <dc:date>2013-03-06T16:29:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to parse long value string</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-parse-long-value-string/m-p/402438#M12237</link>
      <description>&lt;P&gt;can you share the details of what you did to get the XML string parsed?&lt;/P&gt;</description>
      <pubDate>Mon, 09 Oct 2017 17:36:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-parse-long-value-string/m-p/402438#M12237</guid>
      <dc:creator>SIV</dc:creator>
      <dc:date>2017-10-09T17:36:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to parse long value string</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/How-to-parse-long-value-string/m-p/590276#M18059</link>
      <description>&lt;P&gt;Hi Chuy,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you share the details (steps, code ) to achieve this ?&lt;/P&gt;</description>
      <pubDate>Fri, 20 Sep 2019 06:27:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/How-to-parse-long-value-string/m-p/590276#M18059</guid>
      <dc:creator>max7</dc:creator>
      <dc:date>2019-09-20T06:27:32Z</dc:date>
    </item>
  </channel>
</rss>

