<?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: Using a catx statement in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Using-a-catx-statement/m-p/335109#M62923</link>
    <description>&lt;P&gt;1) you miss input file/dataset&lt;/P&gt;
&lt;P&gt;2) if you want to save memory variables add output statement.&lt;/P&gt;
&lt;P&gt;3) you didn not assign value - neither to site nor to pt variables.&lt;/P&gt;
&lt;P&gt;4) LABEL does not assine value to a variable but to the colomn header.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;check next example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; site = 'New-York';&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; pt = 123;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; lablel site_pt = 'New Var';&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; site_pt = catx('-',site,pt);&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; output;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 22 Feb 2017 20:19:20 GMT</pubDate>
    <dc:creator>Shmuel</dc:creator>
    <dc:date>2017-02-22T20:19:20Z</dc:date>
    <item>
      <title>Using a catx statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Using-a-catx-statement/m-p/335096#M62914</link>
      <description>&lt;P&gt;I am trying to combine site and patient with a hyphen in between the two variables, using the catx function. &amp;nbsp;When I run this below, it ONLY gives me these three variables in my data, with no observations....any help is appreciated&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data pat_info;&lt;BR /&gt;length site pt $ 15;&lt;BR /&gt;label pt_id='Site-Patient';&lt;BR /&gt;pt_id = catx('-',site,pt);&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Feb 2017 19:56:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Using-a-catx-statement/m-p/335096#M62914</guid>
      <dc:creator>zjhansen30</dc:creator>
      <dc:date>2017-02-22T19:56:01Z</dc:date>
    </item>
    <item>
      <title>Re: Using a catx statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Using-a-catx-statement/m-p/335098#M62915</link>
      <description>&lt;P&gt;I don't see any kind of set statement or any other source of data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You're running that code on nothing.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Feb 2017 19:59:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Using-a-catx-statement/m-p/335098#M62915</guid>
      <dc:creator>collinelliot</dc:creator>
      <dc:date>2017-02-22T19:59:25Z</dc:date>
    </item>
    <item>
      <title>Re: Using a catx statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Using-a-catx-statement/m-p/335099#M62916</link>
      <description>&lt;P&gt;You are creating variables but not populating them, so the output dataset has no rows/data. You need to either read in the data from another dataset with a set statement, or you need to generate data in your data step. Here's your code with one row of data created in the data step:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data pat_info;
length site pt $ 15;
label pt_id='Site-Patient';
Site='Mysite';
Pt='Patname';
pt_id = catx('-',site,pt);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 22 Feb 2017 20:01:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Using-a-catx-statement/m-p/335099#M62916</guid>
      <dc:creator>nehalsanghvi</dc:creator>
      <dc:date>2017-02-22T20:01:00Z</dc:date>
    </item>
    <item>
      <title>Re: Using a catx statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Using-a-catx-statement/m-p/335100#M62917</link>
      <description>&lt;P&gt;Sorry, this is my full code....I am running it after merging two data sets&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc format;&lt;BR /&gt;value sex&lt;BR /&gt;1=Female&lt;BR /&gt;2=Male&lt;BR /&gt;;&lt;BR /&gt;value race&lt;BR /&gt;1=Asian&lt;BR /&gt;2=Black&lt;BR /&gt;3=Caucasian&lt;BR /&gt;4=Other&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data study;&lt;BR /&gt;&lt;BR /&gt;infile '/courses/dc4508e5ba27fe300/c_629/suppTRP-1062.txt' dlm=',' missover;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;informat Site $1. Pt $2. Dosedate mmddyy10.;&lt;BR /&gt;input Site Pt Sex Race Dosedate Height Weight Result1 Result2 Result3;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;if '01JAN1997'd &amp;lt;= dosedate &amp;lt;= '31DEC1997'd then doselot='S0576';&lt;BR /&gt;else if '31DEC1997'd &amp;lt; dosedate &amp;lt;= '10JAN1998'd then doselot='P1122';&lt;BR /&gt;else if dosedate &amp;gt; '10JAN1998'd then doselot='P0526';&lt;/P&gt;&lt;P&gt;if doselot='P0526' then do;&lt;BR /&gt;prot_amend='B';&lt;BR /&gt;if sex=1 then limit=0.03;&lt;BR /&gt;else if sex=2 then limit=0.02;&lt;BR /&gt;end;&lt;BR /&gt;else if doselot = 'S0576' or doselot='P1122' then do;&lt;BR /&gt;prot_amend='A';&lt;BR /&gt;limit=0.02;&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;length site_name $30;&lt;BR /&gt;select(site);&lt;BR /&gt;when ('J') site_name='Aurora Health Associates';&lt;BR /&gt;when ('Q') site_name='Omaha Medical Center';&lt;BR /&gt;when ('R') site_name='Sherwin Heights Healthcare';&lt;BR /&gt;otherwise;&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;format sex sex. race race. dosedate date.;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;label site='Study Site'&lt;BR /&gt;pt='Patient'&lt;BR /&gt;dosedate='Dose Date'&lt;BR /&gt;doselot='Dose Lot'&lt;BR /&gt;prot_amend='Protocol Amendment'&lt;BR /&gt;limit='Lower Limit of Detection'&lt;BR /&gt;site_name='Site Name';&lt;BR /&gt;run;&lt;BR /&gt;libname demog '/courses/dc4508e5ba27fe300/c_629/saslib' access=readonly;&lt;BR /&gt;proc sort data=demog.demog1062 out=demog;&lt;BR /&gt;by site pt;&lt;BR /&gt;run;&lt;BR /&gt;proc sort data=study;&lt;BR /&gt;by site pt;&lt;BR /&gt;run;&lt;BR /&gt;data pat_info;&lt;BR /&gt;merge demog study;&lt;BR /&gt;by site pt;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Feb 2017 20:01:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Using-a-catx-statement/m-p/335100#M62917</guid>
      <dc:creator>zjhansen30</dc:creator>
      <dc:date>2017-02-22T20:01:17Z</dc:date>
    </item>
    <item>
      <title>Re: Using a catx statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Using-a-catx-statement/m-p/335101#M62918</link>
      <description>&lt;P&gt;You have no statement that reads data into the data step. Either use a set statement to name an existing dataset&amp;nbsp;that contains site and pt, or use infile and input to read data from an external file.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Feb 2017 20:01:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Using-a-catx-statement/m-p/335101#M62918</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-02-22T20:01:55Z</dc:date>
    </item>
    <item>
      <title>Re: Using a catx statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Using-a-catx-statement/m-p/335102#M62919</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So if you add the code to data step as follows, do you still have an issue?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;data pat_info;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;merge demog study;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;by site pt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;label pt_id='Site-Patient';&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;pt_id = catx('-',site,pt);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;run;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Feb 2017 20:04:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Using-a-catx-statement/m-p/335102#M62919</guid>
      <dc:creator>collinelliot</dc:creator>
      <dc:date>2017-02-22T20:04:24Z</dc:date>
    </item>
    <item>
      <title>Re: Using a catx statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Using-a-catx-statement/m-p/335103#M62920</link>
      <description>&lt;P&gt;You can do it while merging:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data pat_info;
merge demog study;
by site pt;&lt;BR /&gt;length site_pt $15;
site_pt = catx('-',site,pt);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 22 Feb 2017 20:05:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Using-a-catx-statement/m-p/335103#M62920</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-02-22T20:05:44Z</dc:date>
    </item>
    <item>
      <title>Re: Using a catx statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Using-a-catx-statement/m-p/335104#M62921</link>
      <description>&lt;P&gt;No, that fixed it. &amp;nbsp;Thank you. &amp;nbsp;I needed it in the statement. &amp;nbsp;I didnt want to put a set statement because I wanted it in the same data set, but putting that in the data step worked. &amp;nbsp;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 22 Feb 2017 20:10:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Using-a-catx-statement/m-p/335104#M62921</guid>
      <dc:creator>zjhansen30</dc:creator>
      <dc:date>2017-02-22T20:10:26Z</dc:date>
    </item>
    <item>
      <title>Re: Using a catx statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Using-a-catx-statement/m-p/335107#M62922</link>
      <description>&lt;P&gt;You're welcome.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Feb 2017 20:13:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Using-a-catx-statement/m-p/335107#M62922</guid>
      <dc:creator>collinelliot</dc:creator>
      <dc:date>2017-02-22T20:13:55Z</dc:date>
    </item>
    <item>
      <title>Re: Using a catx statement</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Using-a-catx-statement/m-p/335109#M62923</link>
      <description>&lt;P&gt;1) you miss input file/dataset&lt;/P&gt;
&lt;P&gt;2) if you want to save memory variables add output statement.&lt;/P&gt;
&lt;P&gt;3) you didn not assign value - neither to site nor to pt variables.&lt;/P&gt;
&lt;P&gt;4) LABEL does not assine value to a variable but to the colomn header.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;check next example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; site = 'New-York';&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; pt = 123;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; lablel site_pt = 'New Var';&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; site_pt = catx('-',site,pt);&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; output;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Feb 2017 20:19:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Using-a-catx-statement/m-p/335109#M62923</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2017-02-22T20:19:20Z</dc:date>
    </item>
  </channel>
</rss>

