<?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 Proc sort deleting variables form data set in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-sort-deleting-variables-form-data-set/m-p/400915#M20905</link>
    <description>&lt;P&gt;Dear All,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much for all the help I have been getting. I am grateful.&lt;/P&gt;&lt;P&gt;I&amp;nbsp;am new SAS user.&lt;/P&gt;&lt;P&gt;My problem...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I&amp;nbsp;am trying to merge 4 sets of data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC IMPORT OUT= DATA_2005&lt;BR /&gt;DATAFILE= "C:\Users\NWUUser\Documents\DOCTORAL WORK\2017 and beyond\2nd PUBLICATION\DATA FOR PAPER 2\Fa_data.sav"&lt;BR /&gt;DBMS=SPSS REPLACE;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;PROC IMPORT OUT= PLASMAFA_2015&lt;BR /&gt;DATAFILE= "C:\Users\NWUUser\Documents\DOCTORAL WORK\2017 and beyond\2nd PUBLICATION\DATA FOR PAPER 2\PLASMAFA_2015PURE.sav"&lt;BR /&gt;DBMS=SPSS REPLACE;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;PROC IMPORT OUT= ANTHRO_2015&lt;BR /&gt;DATAFILE= "C:\Users\NWUUser\Documents\DOCTORAL WORK\2017 and beyond\2nd PUBLICATION\DATA FOR PAPER 2\ANTHRO2015.sav"&lt;BR /&gt;DBMS=SPSS REPLACE;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;PROC IMPORT OUT= INSULIN_2015&lt;BR /&gt;DATAFILE= "C:\Users\NWUUser\Documents\DOCTORAL WORK\2017 and beyond\2nd PUBLICATION\DATA FOR PAPER 2\PURE2015_e411Insulin.sav"&lt;BR /&gt;DBMS=SPSS REPLACE;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I have successfully imported the data.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data DATA_2005;set DATA_2005;&lt;BR /&gt;fa_data=1;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data PLASMAFA_2015;set PLASMAFA_2015;&lt;BR /&gt;PLASMAFA_2015PURE=1;&lt;BR /&gt;format _all_;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data ANTHRO_2015;set ANTHRO_2015;&lt;BR /&gt;ANTHRO2015=1;&lt;BR /&gt;format _all_;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data INSULIN_2015;set INSULIN_2015;&lt;BR /&gt;PURE2015_e411Insulin=1;&lt;BR /&gt;format _all_;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;And successfully created variable for merging&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The problem comes when sorting the data.\&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;When I run the sort data&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sort data=DATA_2005;&lt;BR /&gt;by id2005;&lt;BR /&gt;run;quit;&lt;/P&gt;&lt;P&gt;proc sort data=PLASMAFA_2015;&lt;BR /&gt;by id2005;&lt;BR /&gt;run;quit;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc sort data=ANTHRO_2015;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;by id2005;&lt;/STRONG&gt;&lt;BR /&gt;run;quit;&lt;/P&gt;&lt;P&gt;proc sort data=INSULIN_2015;&lt;BR /&gt;by id2005;&lt;BR /&gt;run;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;The ANTHRO_2015 variables gets deleted and so there are no variables.&amp;nbsp;There are no duplicates.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am able to merge all the data, but the last data set does not have the ANTHRO_variables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am working with longitudinal data,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Worried PhD student&amp;nbsp;&lt;/P&gt;&lt;P&gt;Alice Ojwang&amp;nbsp;&lt;/P&gt;&lt;P&gt;South Africa&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 04 Oct 2017 12:10:28 GMT</pubDate>
    <dc:creator>Achieng</dc:creator>
    <dc:date>2017-10-04T12:10:28Z</dc:date>
    <item>
      <title>Proc sort deleting variables form data set</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-sort-deleting-variables-form-data-set/m-p/400915#M20905</link>
      <description>&lt;P&gt;Dear All,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much for all the help I have been getting. I am grateful.&lt;/P&gt;&lt;P&gt;I&amp;nbsp;am new SAS user.&lt;/P&gt;&lt;P&gt;My problem...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I&amp;nbsp;am trying to merge 4 sets of data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC IMPORT OUT= DATA_2005&lt;BR /&gt;DATAFILE= "C:\Users\NWUUser\Documents\DOCTORAL WORK\2017 and beyond\2nd PUBLICATION\DATA FOR PAPER 2\Fa_data.sav"&lt;BR /&gt;DBMS=SPSS REPLACE;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;PROC IMPORT OUT= PLASMAFA_2015&lt;BR /&gt;DATAFILE= "C:\Users\NWUUser\Documents\DOCTORAL WORK\2017 and beyond\2nd PUBLICATION\DATA FOR PAPER 2\PLASMAFA_2015PURE.sav"&lt;BR /&gt;DBMS=SPSS REPLACE;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;PROC IMPORT OUT= ANTHRO_2015&lt;BR /&gt;DATAFILE= "C:\Users\NWUUser\Documents\DOCTORAL WORK\2017 and beyond\2nd PUBLICATION\DATA FOR PAPER 2\ANTHRO2015.sav"&lt;BR /&gt;DBMS=SPSS REPLACE;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;PROC IMPORT OUT= INSULIN_2015&lt;BR /&gt;DATAFILE= "C:\Users\NWUUser\Documents\DOCTORAL WORK\2017 and beyond\2nd PUBLICATION\DATA FOR PAPER 2\PURE2015_e411Insulin.sav"&lt;BR /&gt;DBMS=SPSS REPLACE;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I have successfully imported the data.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data DATA_2005;set DATA_2005;&lt;BR /&gt;fa_data=1;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data PLASMAFA_2015;set PLASMAFA_2015;&lt;BR /&gt;PLASMAFA_2015PURE=1;&lt;BR /&gt;format _all_;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data ANTHRO_2015;set ANTHRO_2015;&lt;BR /&gt;ANTHRO2015=1;&lt;BR /&gt;format _all_;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data INSULIN_2015;set INSULIN_2015;&lt;BR /&gt;PURE2015_e411Insulin=1;&lt;BR /&gt;format _all_;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;And successfully created variable for merging&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The problem comes when sorting the data.\&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;When I run the sort data&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sort data=DATA_2005;&lt;BR /&gt;by id2005;&lt;BR /&gt;run;quit;&lt;/P&gt;&lt;P&gt;proc sort data=PLASMAFA_2015;&lt;BR /&gt;by id2005;&lt;BR /&gt;run;quit;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc sort data=ANTHRO_2015;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;by id2005;&lt;/STRONG&gt;&lt;BR /&gt;run;quit;&lt;/P&gt;&lt;P&gt;proc sort data=INSULIN_2015;&lt;BR /&gt;by id2005;&lt;BR /&gt;run;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;The ANTHRO_2015 variables gets deleted and so there are no variables.&amp;nbsp;There are no duplicates.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am able to merge all the data, but the last data set does not have the ANTHRO_variables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am working with longitudinal data,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Worried PhD student&amp;nbsp;&lt;/P&gt;&lt;P&gt;Alice Ojwang&amp;nbsp;&lt;/P&gt;&lt;P&gt;South Africa&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Oct 2017 12:10:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-sort-deleting-variables-form-data-set/m-p/400915#M20905</guid>
      <dc:creator>Achieng</dc:creator>
      <dc:date>2017-10-04T12:10:28Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sort deleting variables form data set</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-sort-deleting-variables-form-data-set/m-p/400916#M20906</link>
      <description>&lt;P&gt;Firstly, avoid coding in upcase, or mixed, it makes code hard to read.&amp;nbsp; Also you can post code using the code window - {i} above post, this retains formatting so indentations show correctly.&lt;/P&gt;
&lt;P&gt;Next, we can tell nothing from that code.&amp;nbsp; What does the data look like?&amp;nbsp; Proc sort without nodupkey or where does not remove observations.&amp;nbsp; What is likely is that there has been an error and the data has not been written.&amp;nbsp; What does the log say?&amp;nbsp; Also note you don't need to put quit; after sorts&lt;/P&gt;</description>
      <pubDate>Wed, 04 Oct 2017 12:17:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-sort-deleting-variables-form-data-set/m-p/400916#M20906</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-10-04T12:17:35Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sort deleting variables form data set</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-sort-deleting-variables-form-data-set/m-p/400967#M20908</link>
      <description>&lt;P&gt;Dear RW9,&lt;/P&gt;&lt;P&gt;Thank you for your message,&lt;/P&gt;&lt;P&gt;I will make the changes while coding in the near future.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Identified this problem when I was trying to use the anthropometric variables to analyse data. When I checked the Merged file, it did not have the Anthro variables. I investigated the problem.&amp;nbsp; I realised that&amp;nbsp;When I import the files, the anthro2015&amp;nbsp; data was imported when I&lt;/P&gt;&lt;P&gt;1. I import the files, the anthro2015&amp;nbsp; data was imported,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;when I create&amp;nbsp; a variable in preparation for merging, the data wa still there, when I run the sort command, then the when&lt;/P&gt;&lt;P&gt;I run the sort command, then the variables were deleted. i.e the data file had no variables. I went step by step checking the dat files. I just realised it is only deleted after the sort&amp;nbsp;command.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;How does the data look like?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The datasets have been cleaned and checked for duplicates before merging.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;\looking forward to your help.&lt;/P&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 _2005to2015;
57
58   merge DATA_2005 PLASMAFA_2015 ANTHRO_2015 INSULIN_2015;
59   by id2005;
60   if fa_data=. then delete;
61   IF PLASMAFA_2015PURE=. then delete;
62
63   IF ANTHRO2015_PURE=. then delete;
64   IF PLASMAFA_2015PURE=. then delete;
65   IF PURE2015_e411Insulin=. then delete;
66   run;

NOTE: Variable ANTHRO2015_PURE is uninitialized.
NOTE: MERGE statement has more than one data set with repeats of BY values.
NOTE: There were 711 observations read from the data set WORK.DATA_2005.
NOTE: There were 853 observations read from the data set WORK.PLASMAFA_2015.
NOTE: There were 2121 observations read from the data set WORK.ANTHRO_2015.
NOTE: There were 2080 observations read from the data set WORK.INSULIN_2015.
NOTE: The data set WORK._2005TO2015 has 0 observations and 285 variables.
NOTE: DATA statement used (Total process time):
      real time           0.25 seconds
      cpu time            0.06 seconds


&lt;/CODE&gt;&lt;/PRE&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;PROC IMPORT OUT= DATA_2005
			DATAFILE= "C:\Users\NWUUser\Documents\DOCTORAL WORK\2017 and beyond\2nd PUBLICATION\DATA FOR PAPER 2\Fa_data.sav"
            DBMS=SPSS REPLACE;
RUN;

PROC IMPORT OUT= PLASMAFA_2015
			DATAFILE= "C:\Users\NWUUser\Documents\DOCTORAL WORK\2017 and beyond\2nd PUBLICATION\DATA FOR PAPER 2\PLASMAFA_2015PURE.sav"
            DBMS=SPSS REPLACE;
RUN;


PROC IMPORT OUT= ANTHRO_2015
			DATAFILE= "C:\Users\NWUUser\Documents\DOCTORAL WORK\2017 and beyond\2nd PUBLICATION\DATA FOR PAPER 2\ANTHRO2015.sav"
            DBMS=SPSS REPLACE;
RUN;

PROC IMPORT OUT= INSULIN_2015
			DATAFILE= "C:\Users\NWUUser\Documents\DOCTORAL WORK\2017 and beyond\2nd PUBLICATION\DATA FOR PAPER 2\PURE2015_e411Insulin.sav"
            DBMS=SPSS REPLACE;
RUN;

/*/* create a variable for 2005 to 2015 dataset f_2005;*/use import .sav name;*/;


data DATA_2005;set DATA_2005;
fa_data=1;
run;


data PLASMAFA_2015;set PLASMAFA_2015;
PLASMAFA_2015PURE=1;
format _all_;
run;

data ANTHRO_2015;set ANTHRO_2015;
ANTHRO2015=1;
format _all_;
run;

data INSULIN_2015;set INSULIN_2015;
PURE2015_e411Insulin=1;
format _all_;

run;


/**************************************sort data */;

proc sort data=DATA_2005;
by id2005;
run;quit;

proc sort data=PLASMAFA_2015;
by id2005;
run;quit;

proc sort data=ANTHRO_2015;
by id2005;
run;quit;

proc sort data=INSULIN_2015;
by id2005;
run;quit;

*****************************************************************************************************************
/*Merge all data */;

Data _2005to2015;

merge DATA_2005 PLASMAFA_2015 ANTHRO_2015 INSULIN_2015;
by id2005; 
if fa_data=. then delete; 
IF PLASMAFA_2015PURE=. then delete; 

IF ANTHRO2015_PURE=. then delete; 
IF PLASMAFA_2015PURE=. then delete; 
IF PURE2015_e411Insulin=. then delete; 
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Oct 2017 13:36:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-sort-deleting-variables-form-data-set/m-p/400967#M20908</guid>
      <dc:creator>Achieng</dc:creator>
      <dc:date>2017-10-04T13:36:19Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sort deleting variables form data set</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-sort-deleting-variables-form-data-set/m-p/400982#M20909</link>
      <description>&lt;P&gt;Yes, the log clearly shows your problem:&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token statement"&gt;NOTE&lt;/SPAN&gt;: Variable ANTHRO2015_PURE is uninitialized&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This means there is no variable on any of the input datasets, therefore when you do if that variable is . - which it always will be as SAS creates a default empty variable if it doesn't exist, then the data is removed, which is true in every case.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So the question back to you is where do you believe this variable exists?&amp;nbsp; Its not created in the code you provide, and due to the error, I can't imagine it exists in the data you have imported.&amp;nbsp; Look at the dataset contents and you will see this variable does not exist.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Oct 2017 13:57:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-sort-deleting-variables-form-data-set/m-p/400982#M20909</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-10-04T13:57:40Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sort deleting variables form data set</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-sort-deleting-variables-form-data-set/m-p/401144#M20916</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dear Superuser,&lt;/P&gt;&lt;P&gt;Thank you for your response,&lt;/P&gt;&lt;P&gt;however, being a new user, I am still not getting anywhere.&lt;/P&gt;&lt;P&gt;I have tried again, but getting the same problem exists.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please note the three steps before merging data. There is no indication of a problem yet the anthro data is not being imported. Thanks for your patience, please see the codes and help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;In your response:&lt;/STRONG&gt;&amp;nbsp;......&lt;EM&gt;&lt;U&gt;.therefore when you do if that variable is . - which it always will be as SAS creates a default empty variable if it doesn't exist, then the data is removed, which is true in every case. &lt;/U&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;which is true, but this data set has all variables when I import the data,&amp;nbsp;create the variable, e&lt;U&gt;&lt;STRONG&gt;xcept after I run the sort command, then the variables are deleted except the headings.&lt;/STRONG&gt;&lt;/U&gt; it is cleared and there are&amp;nbsp;no variables, but it does not indicate anywhere in the logs, I only realize that now because I proc print the data variables. Please see the logs&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;&lt;BR /&gt;&lt;BR /&gt;PROC IMPORT OUT= DATA_2005
			DATAFILE= "C:\Users\Ojwang AA\Documents\DOCTORAL WORK\2017 and beyond\2nd PUBLICATION\DATA FOR PAPER 2\Fa_data.sav"
            DBMS=SPSS REPLACE;
RUN;

PROC IMPORT OUT= PLASMAFA_2015
			DATAFILE= "C:\Users\Ojwang AA\Documents\DOCTORAL WORK\2017 and beyond\2nd PUBLICATION\DATA FOR PAPER 2\PLASMAFA_2015PURE.sav"
            DBMS=SPSS REPLACE;
RUN;


PROC IMPORT OUT= ANTHRO_2015
			DATAFILE= "C:\Users\Ojwang AA\Documents\DOCTORAL WORK\2017 and beyond\2nd PUBLICATION\DATA FOR PAPER 2\ANTHRO2015.sav"
            DBMS=SPSS REPLACE;
RUN;

PROC IMPORT OUT= INSULIN_2015
			DATAFILE= "C:\Users\Ojwang AA\Documents\DOCTORAL WORK\2017 and beyond\2nd PUBLICATION\DATA FOR PAPER 2\PURE2015_e411Insulin.sav"
            DBMS=SPSS REPLACE;
RUN;

/*/* create a variable for 2005 to 2015 dataset f_2005;*/use import .sav name;*/;


data DATA_2005;set Data_2005;
fa_data=1;
run;


data Plasmafa_2015;set Plasmafa_2015;
Plasmafa_2015PURE=1;
format _all_;
run;

data Anthro_2015;set Anthro_2015;
Anthro2015=1;
format _all_;
run;

data Insulin_2015;set Insulin_2015;
PURE2015_e411Insulin=1;
format _all_;

run;


/**************************************sort data */;

proc sort data=Data_2005;
by id2005;
run;

proc sort data=Plasmafa_2015;
by id2005;
run;

proc sort data=Anthro_2015;
by id2005;
run;

proc sort data=Insulin_2015;
by id2005;
run;quit;

*****************************************************************************************************************
/*Merge all data */;

Data _2005to2015;

merge DATA_2005 PLASMAFA_2015 ANTHRO_2015 INSULIN_2015;
by id2005; 
if fa_data=. then delete; 
IF PLASMAFA_2015PURE=. then delete; 

IF ANTHRO2015=. then delete; 
IF PLASMAFA_2015PURE=. then delete; 
IF PURE2015_e411Insulin=. then delete; 
run;


PROC IMPORT OUT= DATA_2005
			DATAFILE= "C:\Users\Ojwang AA\Documents\DOCTORAL WORK\2017 and beyond\2nd PUBLICATION\DATA FOR PAPER 2\Fa_data.sav"
            DBMS=SPSS REPLACE;
RUN;

PROC IMPORT OUT= PLASMAFA_2015
			DATAFILE= "C:\Users\Ojwang AA\Documents\DOCTORAL WORK\2017 and beyond\2nd PUBLICATION\DATA FOR PAPER 2\PLASMAFA_2015PURE.sav"
            DBMS=SPSS REPLACE;
RUN;


PROC IMPORT OUT= ANTHRO_2015
			DATAFILE= "C:\Users\Ojwang AA\Documents\DOCTORAL WORK\2017 and beyond\2nd PUBLICATION\DATA FOR PAPER 2\ANTHRO2015.sav"
            DBMS=SPSS REPLACE;
RUN;

PROC IMPORT OUT= INSULIN_2015
			DATAFILE= "C:\Users\Ojwang AA\Documents\DOCTORAL WORK\2017 and beyond\2nd PUBLICATION\DATA FOR PAPER 2\PURE2015_e411Insulin.sav"
            DBMS=SPSS REPLACE;
RUN;

/*/* create a variable for 2005 to 2015 dataset f_2005;*/use import .sav name;*/;


data DATA_2005;set Data_2005;
fa_data=1;
run;


data Plasmafa_2015;set Plasmafa_2015;
Plasmafa_2015PURE=1;
format _all_;
run;

data Anthro_2015;set Anthro_2015;
Anthro2015=1;
format _all_;
run;

data Insulin_2015;set Insulin_2015;
PURE2015_e411Insulin=1;
format _all_;

run;


/**************************************sort data */;

proc sort data=Data_2005;
by id2005;
run;

proc sort data=Plasmafa_2015;
by id2005;
run;

proc sort data=Anthro_2015;
by id2005;
run;

proc sort data=Insulin_2015;
by id2005;
run;quit;

*****************************************************************************************************************
/*Merge all data */;

Data _2005to2015;

merge DATA_2005 PLASMAFA_2015 ANTHRO_2015 INSULIN_2015;
by id2005; 
if fa_data=. then delete; 
IF PLASMAFA_2015PURE=. then delete; 

IF ANTHRO2015=. then delete; 
IF PLASMAFA_2015PURE=. then delete; 
IF PURE2015_e411Insulin=. then delete; 
run;



&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am sorry for the back and forth, but I know this is where I will get the help.&lt;/P&gt;&lt;P&gt;I do appreciate your time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Achieng&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Oct 2017 19:56:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-sort-deleting-variables-form-data-set/m-p/401144#M20916</guid>
      <dc:creator>Achieng</dc:creator>
      <dc:date>2017-10-04T19:56:13Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sort deleting variables form data set</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-sort-deleting-variables-form-data-set/m-p/401234#M20922</link>
      <description>&lt;P&gt;I do not see any logs.&amp;nbsp; Please strip down the question to the actual point.&amp;nbsp; Show the code you believe is the problem, and the log with that code run, and if possible show what the dataset looks like (structure from a proc contents).&amp;nbsp; I repeat that proc sort does not delete data without a nodupkey or where clause, the code you present does not include this so either that is not the code causing the issue or you have issues in your log.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Oct 2017 08:32:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-sort-deleting-variables-form-data-set/m-p/401234#M20922</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-10-05T08:32:04Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sort deleting variables form data set</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-sort-deleting-variables-form-data-set/m-p/401251#M20923</link>
      <description>&lt;P&gt;Dear Superuser,&lt;/P&gt;&lt;P&gt;Thank you once more.&lt;/P&gt;&lt;P&gt;I actually do not understand where the problem is, except that after I merge the data, the Anthro data is not merging with the rest. I have tried everything, I have looked at the data set. Attached is the contents.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Thu, 05 Oct 2017 09:28:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-sort-deleting-variables-form-data-set/m-p/401251#M20923</guid>
      <dc:creator>Achieng</dc:creator>
      <dc:date>2017-10-05T09:28:14Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sort deleting variables form data set</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-sort-deleting-variables-form-data-set/m-p/401271#M20924</link>
      <description>&lt;P&gt;Lets start again.&amp;nbsp; Don't post things as Excel files.&amp;nbsp; Get your data into SAS, then follow this post:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To create datastep versions of your data (only need a couple of rows of each one as an example).&amp;nbsp; Post that text datastep into a code window - it is the {i} above the post area.&amp;nbsp; Once I have something I can actually look at then we can see.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Oct 2017 10:19:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-sort-deleting-variables-form-data-set/m-p/401271#M20924</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-10-05T10:19:27Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sort deleting variables form data set</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-sort-deleting-variables-form-data-set/m-p/401340#M20926</link>
      <description>&lt;P&gt;Dears Superuser,&lt;/P&gt;&lt;P&gt;Thank you for your support.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Well, I have taken 3 hours trying to get you the file. However, I have been unable to generate the data using the codes you gave me. Please don't be upset. I am learning. Is there another way???&lt;/P&gt;&lt;PRE&gt;%data2datastep(Anthro_2015, DATAFILE= "C:\Users\NWUUser\Documents\DOCTORAL WORK\2017 and beyond\2nd PUBLICATION\DATA FOR PAPER 2\ANTHRODATA_2015.sav"
            DBMS=SPSS REPLACE, ANTHRODATA_2015, 5);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I managed to solve the problem.&lt;/P&gt;&lt;P&gt;1. I changed the names of the data files fro Anthrodata set, so they are different i.e&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;ANTHRODATA_2015, &lt;/PRE&gt;&lt;P&gt;2. Then I went through all the processes of merging data....i.e ( import, create a variable, sort ) for all the data sets.&lt;/P&gt;&lt;P&gt;However, before. I run the merge command, I repeated the same process for the Anthro data ( import, create, sort)&amp;nbsp; that was refusing to merge,&amp;nbsp;&lt;/P&gt;&lt;P&gt;3. Finally, it merged. I was so excited, that I don't think I will be putting off my computer, less it does not work tomorrow. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I have not discovered the real problem and If I can get at least part of the data set to you, then you can at least help me understand.&lt;/P&gt;&lt;P&gt;I really do appreciate your time, energy and contribution.&lt;/P&gt;&lt;P&gt;May Jehovah God bless you abundantly.&lt;/P&gt;&lt;P&gt;Yours sincerely&amp;nbsp;&lt;/P&gt;&lt;P&gt;Alice&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Oct 2017 13:59:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-sort-deleting-variables-form-data-set/m-p/401340#M20926</guid>
      <dc:creator>Achieng</dc:creator>
      <dc:date>2017-10-05T13:59:52Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sort deleting variables form data set</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-sort-deleting-variables-form-data-set/m-p/401348#M20927</link>
      <description>&lt;P&gt;You would need to run your proc import, then use the dataset name in the macro call, something like:&lt;/P&gt;
&lt;PRE&gt;PROC IMPORT OUT= ANTHRO_2015
			DATAFILE= "C:\Users\Ojwang AA\Documents\DOCTORAL WORK\2017 and beyond\2nd PUBLICATION\DATA FOR PAPER 2\ANTHRO2015.sav"
            DBMS=SPSS REPLACE;
RUN;

%data2datastep (Anthro_2015, work, c:\temp.txt, 2);&lt;/PRE&gt;
&lt;P&gt;So the proc import gets the data from your external file.&amp;nbsp; The macro will take this dataset and create a text file (I have called it c:\temp.txt - i.e. a file temp.txt in c: drive, you may need to change this).&amp;nbsp; The text in the text file can be copied and pasted into a code window here using the {i} button.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From what you have said, yes, each of the variables in the contributing datasets should be unique if they are not used as merged id's, otherwise SAS will take the first occurence as the value.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Oct 2017 14:14:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-sort-deleting-variables-form-data-set/m-p/401348#M20927</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-10-05T14:14:14Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sort deleting variables form data set</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-sort-deleting-variables-form-data-set/m-p/401379#M20929</link>
      <description>&lt;P&gt;Hello, Superuser,&lt;/P&gt;&lt;P&gt;Thank you for your commitment, and stay here till we solve this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I successfully&amp;nbsp;downloaded the macro.&lt;/P&gt;&lt;PRE&gt;PROC IMPORT OUT= ANTHROTRIAL_2015
			DATAFILE= "C:\Users\NWUUser\Documents\DOCTORAL WORK\2017 and beyond\2nd PUBLICATION\DATA FOR PAPER 2\ANTHRO2015.sav"
            DBMS=SPSS REPLACE;
RUN;&lt;/PRE&gt;&lt;P&gt;I successfully&amp;nbsp;imported the file using the macro window&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I&amp;nbsp;am still unable to create the temporary text file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the error I&amp;nbsp;am getting&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;%macro %data2datastep (Anthrotrial_2015, work, c:\temp.txt, 2);
run;&lt;/PRE&gt;&lt;PRE&gt;&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;obviously you can see the amateur at work &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Thu, 05 Oct 2017 15:04:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-sort-deleting-variables-form-data-set/m-p/401379#M20929</guid>
      <dc:creator>Achieng</dc:creator>
      <dc:date>2017-10-05T15:04:31Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sort deleting variables form data set</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-sort-deleting-variables-form-data-set/m-p/401382#M20930</link>
      <description>&lt;PRE&gt;%data2datastep (Anthrotrial_2015, work, c:\temp.txt, 2);&lt;/PRE&gt;
&lt;P&gt;You may want to run through some basics of SAS programming before going further.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As for your issue, its because you have variables which are the same name across the datasets, you can only have one in the output dataset so SAS takes the first one.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Oct 2017 15:07:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-sort-deleting-variables-form-data-set/m-p/401382#M20930</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-10-05T15:07:31Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sort deleting variables form data set</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-sort-deleting-variables-form-data-set/m-p/401390#M20931</link>
      <description>&lt;P&gt;Thank you Superuser,&lt;/P&gt;&lt;P&gt;I will learn as we go along. I am&amp;nbsp;actually just trying to learn on my own. I am PhD student and I am required to use SAS for my data analysis. I have basically trained myself and still training, Obviously, I&amp;nbsp;am jumping steps, as you can see. Thank you very much.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think the problem was truly the similar names.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please feel free to recommend some&amp;nbsp;links I can use for learning.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Otherwise, thank you very much for staying committed. This was my first post and I am very happy with the help you have provided.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I shall be back here shortly with questions about logistic regression modelling.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Very kind regards&lt;/P&gt;&lt;P&gt;Achieng&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Oct 2017 15:15:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-sort-deleting-variables-form-data-set/m-p/401390#M20931</guid>
      <dc:creator>Achieng</dc:creator>
      <dc:date>2017-10-05T15:15:42Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sort deleting variables form data set</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-sort-deleting-variables-form-data-set/m-p/401404#M20933</link>
      <description>&lt;P&gt;No probs.&amp;nbsp; You can find a lot of help online, main part will be the documentation&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/onlinedoc/base/" target="_blank"&gt;http://support.sas.com/documentation/onlinedoc/base/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then there is SAS provided video tutorials;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://video.sas.com/" target="_blank"&gt;http://video.sas.com/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For graphs, this blog is essential reading, lots of examples of pretty much any graph;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.sas.com/content/graphicallyspeaking/" target="_blank"&gt;http://blogs.sas.com/content/graphicallyspeaking/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And finally using the search on these forums, there is lots of information here.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Oct 2017 15:45:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-sort-deleting-variables-form-data-set/m-p/401404#M20933</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-10-05T15:45:05Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sort deleting variables form data set</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-sort-deleting-variables-form-data-set/m-p/401643#M20941</link>
      <description>&lt;P&gt;Thank you Very much.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Very Kind regards&lt;/P&gt;&lt;P&gt;Achieng&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Oct 2017 08:13:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-sort-deleting-variables-form-data-set/m-p/401643#M20941</guid>
      <dc:creator>Achieng</dc:creator>
      <dc:date>2017-10-06T08:13:17Z</dc:date>
    </item>
    <item>
      <title>Re: GEE mode with longitudinal data</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-sort-deleting-variables-form-data-set/m-p/401675#M20942</link>
      <description>&lt;P&gt;Dear Great SAS help team&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am working with longitudinal data and I need to perform logistic regression using GEE. baseline data in 2005 and follow up data in 2015.&amp;nbsp;All the data has been cleaned and has been merged for all the participants with follow up data.&amp;nbsp;However, I have a few&amp;nbsp;questions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my data set, I have predictors (Fatty acids, fatty acid patterns) all&lt;/P&gt;&lt;P&gt;1. Predictors (Fatty acids, fatty acid patterns both dietary and plasma phospholipids) all continuous variables.&lt;/P&gt;&lt;P&gt;2.confounders&amp;nbsp; (Gender, Urbanisation,&amp;nbsp;HIVstatus&lt;U&gt;, &lt;STRONG&gt;Alcohol, Tobacco, Education)&lt;/STRONG&gt;&lt;/U&gt; are all categorical variables&amp;nbsp;while (age, Energyintake and&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;&lt;U&gt;PhyAct&lt;/U&gt;&lt;/STRONG&gt; ) are continuous variables.&lt;/P&gt;&lt;P&gt;3. I have outcomes ( Wtchange, BMIchange, Waistchangeand Metabolic syndrome (MetS) measures over 10 years. i.e I have data collected in 2005 and data collected in 2015. The outcomes are ten-year change.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The Underlined variables have some missing values and I cannot get results.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Questions 1. Can you create models with GEE and prospective data??&lt;/P&gt;&lt;P&gt;for example When analysing linear regression for cross-sectional&amp;nbsp;study, and logistic regression, I was able to create models.&lt;/P&gt;&lt;P&gt;Model 1_crude model&lt;/P&gt;&lt;P&gt;Model 2- Adjusted for age and gender&lt;/P&gt;&lt;P&gt;Model 3_ adjusted for lifestyle factors.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been unable to figure out how to include that in the GEE analysis; I have been able to add only one confounder at a time, is this alright,.&lt;/P&gt;&lt;PRE&gt; proc genmod data=_2005to2015 ;
class Age2015;
model  WTchangeInd= n3_PLASMA_2005 n6_PLASMA_2005 SCD_D9D_Plasma_2005 EFA_PLASMA_2005/ dist=bin;;
      repeated  subject=Age2015 / type=exch covb corrw;
   run;&lt;/PRE&gt;&lt;PRE&gt;315   proc genmod data=_2005to2015 ;
316  class Age2015;
317  model  WTchangeInd= n3_PLASMA_2005 n6_PLASMA_2005 SCD_D9D_Plasma_2005 EFA_PLASMA_2005/
317! dist=bin;;
318        repeated  subject=Age2015 / type=exch covb corrw;
319     run;

NOTE: Class levels for some variables were not printed due to excessive size.
NOTE: PROC GENMOD is modeling the probability that WTchangeInd='1'. One way to change this to
      model the probability that WTchangeInd='2' is to specify the DESCENDING option in the
      PROC statement.
NOTE: Algorithm converged.
NOTE: Algorithm converged.
NOTE: PROCEDURE GENMOD used (Total process time):
      real time           0.15 seconds
      cpu time            0.09 seconds

&lt;/PRE&gt;&lt;P&gt;When I run the data with HIVstatus as confounder;&lt;/P&gt;&lt;PRE&gt; proc genmod data=_2005to2015 desc ; 
class HIVstatus_2005 ;
model  WTchangeInd= n3_PLASMA_2005 n6_PLASMA_2005 SCD_D9D_Plasma_2005 EFA_PLASMA_2005/ dist=bin;;
      repeated  subject=HIVstatus_2005  / type=exch covb corrw;
	  
   run;&lt;/PRE&gt;&lt;P&gt;This is the result&amp;nbsp;&lt;/P&gt;&lt;PRE&gt; 
325   proc genmod data=_2005to2015 desc ; /*exclude missing data*/;
326  class HIVstatus_2005 ;
327  model  WTchangeInd= n3_PLASMA_2005 n6_PLASMA_2005 SCD_D9D_Plasma_2005 EFA_PLASMA_2005/
327! dist=bin;;
328        repeated  subject=HIVstatus_2005  / type=exch covb corrw;
329
330     run;

NOTE: PROC GENMOD is modeling the probability that WTchangeInd='2'.
NOTE: Algorithm converged.
ERROR: A missing value was detected in the SUBJECT, WITHINSUBJECT, or LOGORVAR effect. All
       values of variables in these effects must be non-missing.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE GENMOD used (Total process time):
      real time           0.09 seconds
      cpu time            0.03 seconds



&lt;/PRE&gt;&lt;P&gt;For me to get these results, I had to categorize the weight change into 2 categories, It was earlier in 3 categories, but with two categories I was able to get somewhere.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Question 2&lt;/STRONG&gt;: Is it possible show the association 3 categories of change&amp;nbsp;with predictors and confounders: For example.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have 3 weight change categories&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cat1: weightloss&lt;/P&gt;&lt;P&gt;Cat2: Nochange&lt;/P&gt;&lt;P&gt;Cat3: Weightgain&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I arrange my odes so that I can be able to show the association of my predictors with 1 weight loss, 2 Nochange and 3 Weightgain?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please recommend the best way to go about this. Please be patient with me, I am very new to SAS&lt;/P&gt;&lt;P&gt;Very kind regards&lt;/P&gt;&lt;P&gt;Achieng&lt;/P&gt;</description>
      <pubDate>Fri, 06 Oct 2017 10:08:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-sort-deleting-variables-form-data-set/m-p/401675#M20942</guid>
      <dc:creator>Achieng</dc:creator>
      <dc:date>2017-10-06T10:08:15Z</dc:date>
    </item>
    <item>
      <title>Re: GEE mode with longitudinal data</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-sort-deleting-variables-form-data-set/m-p/401676#M20943</link>
      <description>&lt;P&gt;Please start a new topic.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Oct 2017 10:10:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-sort-deleting-variables-form-data-set/m-p/401676#M20943</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-10-06T10:10:54Z</dc:date>
    </item>
    <item>
      <title>Re: GEE mode with longitudinal data</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-sort-deleting-variables-form-data-set/m-p/401695#M20944</link>
      <description>Ok will do&lt;BR /&gt;</description>
      <pubDate>Fri, 06 Oct 2017 10:52:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-sort-deleting-variables-form-data-set/m-p/401695#M20944</guid>
      <dc:creator>Achieng</dc:creator>
      <dc:date>2017-10-06T10:52:35Z</dc:date>
    </item>
  </channel>
</rss>

