<?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: Problem with Little's MCAR macro in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Problem-with-Little-s-MCAR-macro/m-p/635823#M78090</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suggest you turn on options MPRINT, run the macro, and review the log.&amp;nbsp; The macro generates several steps.&amp;nbsp; Which step does the error occur in?&amp;nbsp; What does the error message say?&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The macro was written to analyze one specific file,&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;%let datafile = "c:\data\eatingrisk.dat"; 
&lt;/PRE&gt;
&lt;P&gt;Do you have that data file in c:\data?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you can't see what's happening from the log, I suggest you post the log.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 30 Mar 2020 14:21:52 GMT</pubDate>
    <dc:creator>Quentin</dc:creator>
    <dc:date>2020-03-30T14:21:52Z</dc:date>
    <item>
      <title>Problem with Little's MCAR macro</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Problem-with-Little-s-MCAR-macro/m-p/635819#M78089</link>
      <description>&lt;P&gt;Hi all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to run this macro for Little's MCAR test:&amp;nbsp;&lt;A href="http://www.appliedmissingdata.com/littles-mcar-test.sas" target="_blank"&gt;http://www.appliedmissingdata.com/littles-mcar-test.sas&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I am getting error messages saying data are invalid for each of my variables...&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried having the dat file as comma vs tab delimited, with and without the first row of variable names, double-checked that there are no non-numerical values... Still getting an error message.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What else do you think the cause of error can be?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Mar 2020 14:07:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Problem-with-Little-s-MCAR-macro/m-p/635819#M78089</guid>
      <dc:creator>Amanda_Lemon</dc:creator>
      <dc:date>2020-03-30T14:07:17Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Little's MCAR macro</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Problem-with-Little-s-MCAR-macro/m-p/635823#M78090</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suggest you turn on options MPRINT, run the macro, and review the log.&amp;nbsp; The macro generates several steps.&amp;nbsp; Which step does the error occur in?&amp;nbsp; What does the error message say?&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The macro was written to analyze one specific file,&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;%let datafile = "c:\data\eatingrisk.dat"; 
&lt;/PRE&gt;
&lt;P&gt;Do you have that data file in c:\data?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you can't see what's happening from the log, I suggest you post the log.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Mar 2020 14:21:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Problem-with-Little-s-MCAR-macro/m-p/635823#M78090</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2020-03-30T14:21:52Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Little's MCAR macro</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Problem-with-Little-s-MCAR-macro/m-p/635860#M78092</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/151986"&gt;@Amanda_Lemon&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With the example values for &lt;FONT face="courier new,courier"&gt;&amp;amp;datafile&lt;/FONT&gt; and &lt;FONT face="courier new,courier"&gt;&amp;amp;varlist&lt;/FONT&gt; given in the code, the macro uses a simple method of reading the raw data (rather than accepting a SAS dataset as input, which I think is more common):&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;infile &amp;amp;datafile;
input &amp;amp;varlist;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Hence, either your raw data file needs to be&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;EM&gt;space&lt;/EM&gt;-delimited&lt;/LI&gt;
&lt;LI&gt;without variable names&lt;/LI&gt;
&lt;LI&gt;containing only numeric values (readable without specifying informats)&lt;/LI&gt;
&lt;LI&gt;representing missing values with single periods (.)&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;or you need to add options, informats, etc. needed to read&amp;nbsp;&lt;EM&gt;your&lt;/EM&gt; raw data to the values specified in the %LET statements for &lt;FONT face="courier new,courier"&gt;datafile&lt;/FONT&gt; or&amp;nbsp;&lt;FONT face="courier new,courier"&gt;varlist&lt;/FONT&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let datafile = 'C:\yourfolder\yourfile.csv' dsd missover;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;for a comma-separated file with missing values represented by periods or blanks or null strings.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Mar 2020 15:52:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Problem-with-Little-s-MCAR-macro/m-p/635860#M78092</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2020-03-30T15:52:51Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Little's MCAR macro</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Problem-with-Little-s-MCAR-macro/m-p/636079#M78099</link>
      <description>&lt;P&gt;Thank you for your replies! I followed FreelanceReinhard's recommendation and added&lt;/P&gt;&lt;PRE class="language-sas"&gt;&lt;CODE&gt;dsd missover&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;to the datafile line. My raw file is comma-delimited, periods for missing data, no variable names. The number of error messages decreased but no all... I am including the log below. The program gets the # of observations right. However, the # of variables is 175, not 349...&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;NOTE: A byte-order mark in the file "C:\Users\Desktop\Data_READY_3.dat" (for fileref "#LN00147") indicates that the data is encoded in
      "utf-8".  This encoding will be used to process the file.
NOTE: The infile "C:\Users\Desktop\Data_READY_3.dat" is:
      Filename=C:\Users\Desktop\Data_READY_3.dat,
      RECFM=V,LRECL=131068,File Size (bytes)=466817,
      Last Modified=31Mar2020:00:48:29,
      Create Time=31Mar2020:00:48:29

NOTE: 1274 records were read from the infile "C:\Users\Desktop\Data_READY_3.dat".
      The minimum record length was 355.
      The maximum record length was 383.
NOTE: The data set WORK.ONE has 1274 observations and 349 variables.
NOTE: DATA statement used (Total process time):
      real time           0.03 seconds
      cpu time            0.03 seconds



NOTE: There were 1274 observations read from the data set WORK.ONE.
NOTE: The data set WORK.ONE has 1274 observations and 349 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds


ERROR: Variable I not found.
NOTE: PROCEDURE MI used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds

NOTE: The SAS System stopped processing this step because of errors.


NOTE: IML Ready
ERROR: I is not in the scope of variables for the data set.

 statement : READ at line 3482 column 1
ERROR: File WORK.EMCOV.DATA does not exist.

 statement : USE at line 3482 column 1
ERROR: I is not in the scope of variables for the data set.

 statement : READ at line 3482 column 1
ERROR: (execution) Matrix has not been set to a value.

 operation : [ at line 3482 column 1
 operands  : em, *LIT1004,

em      0 row       0 col     (numeric)


*LIT1004      1 row       1 col     (numeric)

         1

 statement : ASSIGN at line 3482 column 1
ERROR: (execution) Matrix has not been set to a value.

 operation : [ at line 3482 column 1
 operands  : em, *LIT1005, _TEM1001,

em      0 row       0 col     (numeric)


*LIT1005      1 row       1 col     (numeric)

         2

_TEM1001      1 row       1 col     (numeric)

         0

 statement : ASSIGN at line 3482 column 1
ERROR: (execution) Invalid operand to operation.

 operation : J at line 3482 column 1
 operands  : _TEM1001, *LIT1006, *LIT1007

_TEM1001      1 row       1 col     (numeric)

         0

*LIT1006      1 row       1 col     (numeric)

         1

*LIT1007      1 row       1 col     (numeric)

         1

 statement : ASSIGN at line 3482 column 1
ERROR: (execution) Matrix has not been set to a value.

 operation : MAX at line 3482 column 1
 operands  : jcol

jcol      0 row       0 col     (type ?, size 0)


 statement : ASSIGN at line 3482 column 1
ERROR: (execution) Matrix has not been set to a value.

 operation : J at line 3482 column 1
 operands  : j, *LIT1015, *LIT1016

j      0 row       0 col     (type ?, size 0)


*LIT1015      1 row       1 col     (numeric)

         1

*LIT1016      1 row       1 col     (numeric)

         0

 statement : ASSIGN at line 3482 column 1
ERROR: (execution) Matrix has not been set to a value.

 operation : J at line 3482 column 1
 operands  : j, _TEM1001, *LIT1017

j      0 row       0 col     (type ?, size 0)


_TEM1001      1 row       1 col     (numeric)

       175

*LIT1017      1 row       1 col     (numeric)

         0

 statement : ASSIGN at line 3482 column 1
ERROR: DO expression not given value.

 statement : DO at line 3482 column 1
ERROR: (execution) Matrix has not been set to a value.

 operation : J at line 3482 column 1
 operands  : j, *LIT1023, *LIT1024

j      0 row       0 col     (type ?, size 0)


*LIT1023      1 row       1 col     (numeric)

         1

*LIT1024      1 row       1 col     (numeric)

         0

 statement : ASSIGN at line 3482 column 1
ERROR: DO expression not given value.

 statement : DO at line 3482 column 1
ERROR: (execution) Matrix has not been set to a value.

 operation : [ at line 3482 column 1
 operands  : d2j, $SUB0001,

d2j      0 row       0 col     (type ?, size 0)


 statement : ASSIGN at line 3482 column 1
ERROR: (execution) Matrix has not been set to a value.

 operation : [ at line 3482 column 1
 operands  : rj, $SUB0001, $SUB0001

rj      0 row       0 col     (type ?, size 0)


 statement : ASSIGN at line 3482 column 1
ERROR: (execution) Matrix has not been set to a value.

 operation : PROBCHI at line 3482 column 1
 operands  : d2, df

D2      0 row       0 col     (numeric)


df      0 row       0 col     (type ?, size 0)


 statement : ASSIGN at line 3482 column 1
ERROR: Operand j does not have a value.

 statement : PUT at line 3482 column 1
ERROR: (execution) Matrix has not been set to a value.

 operation : [ at line 3482 column 1
 operands  : rj, $SUB0001, $SUB0001

rj      0 row       0 col     (type ?, size 0)


 statement : PUT at line 3482 column 1
ERROR: Operand D2 does not have a value.

 statement : PUT at line 3482 column 1
ERROR: Operand df does not have a value.

 statement : PUT at line 3482 column 1
ERROR: Operand p does not have a value.

 statement : PUT at line 3482 column 1
3483
3484  run;
NOTE: Module MAIN is undefined in IML; cannot be RUN.
3485
3486  quit;
NOTE: Exiting IML.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE IML used (Total process time):
      real time           0.14 seconds
      cpu time            0.07 seconds


&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Mar 2020 05:04:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Problem-with-Little-s-MCAR-macro/m-p/636079#M78099</guid>
      <dc:creator>Amanda_Lemon</dc:creator>
      <dc:date>2020-03-31T05:04:29Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Little's MCAR macro</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Problem-with-Little-s-MCAR-macro/m-p/636113#M78100</link>
      <description>&lt;P&gt;Thanks for posting the log.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;The number of variables in dataset WORK.ONE is determined by the number of variable names specified in the INPUT statement, i.e., in macro variable VARLIST. Does this list contain 175 or 349 "words" (separated by blanks)? For testing purposes, you may want to truncate this variable list (and the list in macro variable TESTVARS correspondingly) to less than 10 items and try to achieve an error-free log before going further.&lt;/LI&gt;
&lt;LI&gt;The error message "Variable I not found" from PROC MI suggests that your variable list in macro variable TESTVARS contains the name "I" (or "i"). You would need to name this variable differently (e.g., &lt;FONT face="courier new,courier"&gt;&lt;FONT color="#FF0000"&gt;_&lt;/FONT&gt;i&lt;/FONT&gt;) because macro MCARTEST uses a variable &lt;FONT face="courier new,courier"&gt;i&lt;/FONT&gt; as an index variable of a DO loop. There might be more name conflicts (&lt;FONT face="courier new,courier"&gt;j&lt;/FONT&gt;, &lt;FONT face="courier new,courier"&gt;k&lt;/FONT&gt;, ...) -- see program code in the macro.&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Tue, 31 Mar 2020 08:41:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Problem-with-Little-s-MCAR-macro/m-p/636113#M78100</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2020-03-31T08:41:39Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Little's MCAR macro</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Problem-with-Little-s-MCAR-macro/m-p/636115#M78101</link>
      <description>Thank you so much! The problem was in the I variable. I renamed it, and the macro worked! Thanks again!</description>
      <pubDate>Tue, 31 Mar 2020 08:56:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Problem-with-Little-s-MCAR-macro/m-p/636115#M78101</guid>
      <dc:creator>Amanda_Lemon</dc:creator>
      <dc:date>2020-03-31T08:56:03Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Little's MCAR macro</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Problem-with-Little-s-MCAR-macro/m-p/636162#M78102</link>
      <description>&lt;P&gt;Just wanted to ask about one more thing -- as I was examining the log, there is a notice "NOTE: Module MAIN is undefined in IML; cannot be RUN." Is this a problem? Why did this notice occur? I do get results even with this notice.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Mar 2020 10:45:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Problem-with-Little-s-MCAR-macro/m-p/636162#M78102</guid>
      <dc:creator>Amanda_Lemon</dc:creator>
      <dc:date>2020-03-31T10:45:52Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Little's MCAR macro</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Problem-with-Little-s-MCAR-macro/m-p/636203#M78103</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/151986"&gt;@Amanda_Lemon&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Just wanted to ask about one more thing -- as I was examining the log, there is a notice "NOTE: Module MAIN is undefined in IML; cannot be RUN." Is this a problem? Why did this notice occur? I do get results even with this notice.&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I suspect that you just need to replace the &lt;FONT size="4" color="#FF0000"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;run;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt; at the bottom of your code by &lt;FONT size="4" color="#008000"&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;quit;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt; to get rid of this note, but I can't test it because I don't have a SAS/IML license. There is no module defined in the macro (this would be indicated by a START and a FINISH statement), which is why the RUN statement attempts to run a module of the default name "main" -- but this doesn't exist either, hence the note in the log.&lt;/P&gt;</description>
      <pubDate>Tue, 31 Mar 2020 12:31:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Problem-with-Little-s-MCAR-macro/m-p/636203#M78103</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2020-03-31T12:31:59Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Little's MCAR macro</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Problem-with-Little-s-MCAR-macro/m-p/636518#M78113</link>
      <description>That was it! Thank you so much!!</description>
      <pubDate>Wed, 01 Apr 2020 12:56:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Problem-with-Little-s-MCAR-macro/m-p/636518#M78113</guid>
      <dc:creator>Amanda_Lemon</dc:creator>
      <dc:date>2020-04-01T12:56:59Z</dc:date>
    </item>
  </channel>
</rss>

