<?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: Any 'cell' in database NOT CONTAINING a %... change to missing in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Any-cell-in-database-NOT-CONTAINING-a-change-to-missing/m-p/717185#M221763</link>
    <description>&lt;P&gt;So if any cell in a column contains text like `%` then SAS will define the variable as character.&amp;nbsp; So you really just need to process the character variables in your dataset.&amp;nbsp;&amp;nbsp;Regex is overkill for such a simple test.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So if your existing dataset is name HAVE this data step will create a copy into a new dataset named WANT that has the character values modified in the way you want.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set have;
  array _ch _character_;
  do index=1 to dim(_ch);
    if not index(_ch[index],'%') then _ch[index]=' ';
  end;
  drop index;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you want to only do it when the % is at the end then change the test to:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;    if not char(_ch[index],length(_ch[index])) = '%' then _ch[index]=' ';&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 05 Feb 2021 19:25:27 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2021-02-05T19:25:27Z</dc:date>
    <item>
      <title>Any 'cell' in database NOT CONTAINING a %... change to missing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Any-cell-in-database-NOT-CONTAINING-a-change-to-missing/m-p/716981#M221680</link>
      <description>&lt;P&gt;Database (Imported from Excel) contains 'cells' containing a % sign, and cells with no % sign.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Would like to go through entire database, and if NO %, simply DELETE whatever is presently there in the cell.&amp;nbsp; Result, empty cell.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If there IS a % somewhere in the cell (generally at end, such as +2.07%), leave that cell alone.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another alternative approach would be to KEEP ONLY those 'cells' where there exists the symbol %.&amp;nbsp; All other cells should be deleted.&amp;nbsp; Even better, use RegEx, and insist the % be at the end of the line, such as&amp;nbsp;+2.07%.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Suggestions greatly appreciated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;P&gt;Nicholas Kormanik&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class="ms-editor-squiggler" style="color: initial; font: initial; font-feature-settings: initial; font-kerning: initial; font-optical-sizing: initial; font-variation-settings: initial; forced-color-adjust: initial; text-orientation: initial; text-rendering: initial; -webkit-font-smoothing: initial; -webkit-locale: initial; -webkit-text-orientation: initial; -webkit-writing-mode: initial; writing-mode: initial; zoom: initial; place-content: initial; place-items: initial; place-self: initial; alignment-baseline: initial; animation: initial; appearance: initial; aspect-ratio: initial; backdrop-filter: initial; backface-visibility: initial; background: initial; background-blend-mode: initial; baseline-shift: initial; block-size: initial; border-block: initial; border: initial; border-radius: initial; border-collapse: initial; border-inline: initial; inset: initial; box-shadow: initial; box-sizing: initial; break-after: initial; break-before: initial; break-inside: initial; buffered-rendering: initial; caption-side: initial; caret-color: initial; clear: initial; clip: initial; clip-path: initial; clip-rule: initial; color-interpolation: initial; color-interpolation-filters: initial; color-rendering: initial; color-scheme: initial; columns: initial; column-fill: initial; gap: initial; column-rule: initial; column-span: initial; contain: initial; contain-intrinsic-size: initial; content: initial; content-visibility: initial; counter-increment: initial; counter-reset: initial; counter-set: initial; cursor: initial; cx: initial; cy: initial; d: initial; display: block; dominant-baseline: initial; empty-cells: initial; fill: initial; fill-opacity: initial; fill-rule: initial; filter: initial; flex: initial; flex-flow: initial; float: initial; flood-color: initial; flood-opacity: initial; grid: initial; grid-area: initial; height: initial; hyphens: initial; image-orientation: initial; image-rendering: initial; inline-size: initial; inset-block: initial; inset-inline: initial; isolation: initial; letter-spacing: initial; lighting-color: initial; line-break: initial; list-style: initial; margin-block: initial; margin: initial; margin-inline: initial; marker: initial; mask: initial; mask-type: initial; max-block-size: initial; max-height: initial; max-inline-size: initial; max-width: initial; min-block-size: initial; min-height: initial; min-inline-size: initial; min-width: initial; mix-blend-mode: initial; object-fit: initial; object-position: initial; offset: initial; opacity: initial; order: initial; origin-trial-test-property: initial; orphans: initial; outline: initial; outline-offset: initial; overflow-anchor: initial; overflow-wrap: initial; overflow: initial; overscroll-behavior-block: initial; overscroll-behavior-inline: initial; overscroll-behavior: initial; padding-block: initial; padding: initial; padding-inline: initial; page: initial; page-orientation: initial; paint-order: initial; perspective: initial; perspective-origin: initial; pointer-events: initial; position: initial; quotes: initial; r: initial; resize: initial; ruby-position: initial; rx: initial; ry: initial; scroll-behavior: initial; scroll-margin-block: initial; scroll-margin: initial; scroll-margin-inline: initial; scroll-padding-block: initial; scroll-padding: initial; scroll-padding-inline: initial; scroll-snap-align: initial; scroll-snap-stop: initial; scroll-snap-type: initial; shape-image-threshold: initial; shape-margin: initial; shape-outside: initial; shape-rendering: initial; size: initial; speak: initial; stop-color: initial; stop-opacity: initial; stroke: initial; stroke-dasharray: initial; stroke-dashoffset: initial; stroke-linecap: initial; stroke-linejoin: initial; stroke-miterlimit: initial; stroke-opacity: initial; stroke-width: initial; tab-size: initial; table-layout: initial; text-align: initial; text-align-last: initial; text-anchor: initial; text-combine-upright: initial; text-decoration: initial; text-decoration-skip-ink: initial; text-indent: initial; text-overflow: initial; text-shadow: initial; text-size-adjust: initial; text-transform: initial; text-underline-offset: initial; text-underline-position: initial; touch-action: initial; transform: initial; transform-box: initial; transform-origin: initial; transform-style: initial; transition: initial; user-select: initial; vector-effect: initial; vertical-align: initial; visibility: initial; -webkit-app-region: initial; border-spacing: initial; -webkit-border-image: initial; -webkit-box-align: initial; -webkit-box-decoration-break: initial; -webkit-box-direction: initial; -webkit-box-flex: initial; -webkit-box-ordinal-group: initial; -webkit-box-orient: initial; -webkit-box-pack: initial; -webkit-box-reflect: initial; -webkit-highlight: initial; -webkit-hyphenate-character: initial; -webkit-line-break: initial; -webkit-line-clamp: initial; -webkit-mask-box-image: initial; -webkit-mask: initial; -webkit-mask-composite: initial; -webkit-perspective-origin-x: initial; -webkit-perspective-origin-y: initial; -webkit-print-color-adjust: initial; -webkit-rtl-ordering: initial; -webkit-ruby-position: initial; -webkit-tap-highlight-color: initial; -webkit-text-combine: initial; -webkit-text-decorations-in-effect: initial; -webkit-text-emphasis: initial; -webkit-text-emphasis-position: initial; -webkit-text-fill-color: initial; -webkit-text-security: initial; -webkit-text-stroke: initial; -webkit-transform-origin-x: initial; -webkit-transform-origin-y: initial; -webkit-transform-origin-z: initial; -webkit-user-drag: initial; -webkit-user-modify: initial; white-space: initial; widows: initial; width: initial; will-change: initial; word-break: initial; word-spacing: initial; x: initial; y: initial; z-index: initial;"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Fri, 05 Feb 2021 08:41:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Any-cell-in-database-NOT-CONTAINING-a-change-to-missing/m-p/716981#M221680</guid>
      <dc:creator>NKormanik</dc:creator>
      <dc:date>2021-02-05T08:41:42Z</dc:date>
    </item>
    <item>
      <title>Re: Any 'cell' in database NOT CONTAINING a %... change to missing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Any-cell-in-database-NOT-CONTAINING-a-change-to-missing/m-p/717183#M221761</link>
      <description>&lt;P&gt;This is could be handled using Excel's Find and Replace.&amp;nbsp; ?&lt;/P&gt;</description>
      <pubDate>Fri, 05 Feb 2021 19:18:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Any-cell-in-database-NOT-CONTAINING-a-change-to-missing/m-p/717183#M221761</guid>
      <dc:creator>PhilC</dc:creator>
      <dc:date>2021-02-05T19:18:13Z</dc:date>
    </item>
    <item>
      <title>Re: Any 'cell' in database NOT CONTAINING a %... change to missing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Any-cell-in-database-NOT-CONTAINING-a-change-to-missing/m-p/717185#M221763</link>
      <description>&lt;P&gt;So if any cell in a column contains text like `%` then SAS will define the variable as character.&amp;nbsp; So you really just need to process the character variables in your dataset.&amp;nbsp;&amp;nbsp;Regex is overkill for such a simple test.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So if your existing dataset is name HAVE this data step will create a copy into a new dataset named WANT that has the character values modified in the way you want.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set have;
  array _ch _character_;
  do index=1 to dim(_ch);
    if not index(_ch[index],'%') then _ch[index]=' ';
  end;
  drop index;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you want to only do it when the % is at the end then change the test to:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;    if not char(_ch[index],length(_ch[index])) = '%' then _ch[index]=' ';&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Feb 2021 19:25:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Any-cell-in-database-NOT-CONTAINING-a-change-to-missing/m-p/717185#M221763</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-02-05T19:25:27Z</dc:date>
    </item>
  </channel>
</rss>

