<?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: Macro help - defined variables are all missing in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Macro-help-defined-variables-are-all-missing/m-p/396954#M95896</link>
    <description>&lt;P&gt;My issue is that the variables dob, school and recnum are missing for all observations when I open "one" in work.library. When&amp;nbsp;I submit PROC PRINT DATA=ONE the values for dob, school and recnum are there.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need these variables in a subsequent step in order to do some matching.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 18 Sep 2017 20:32:39 GMT</pubDate>
    <dc:creator>GreggB</dc:creator>
    <dc:date>2017-09-18T20:32:39Z</dc:date>
    <item>
      <title>Macro help - defined variables are all missing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-help-defined-variables-are-all-missing/m-p/396929#M95889</link>
      <description>&lt;P&gt;&lt;SPAN&gt;This macro seems to work fine except that my defined vars (school, dob and recnum) are all blank when I open data set ONE in the work library. However, when I submit the PROC PRINT DATA=ONE &amp;nbsp;statement all of those defined vars show up in the output as I expect. Vars in question are colored red.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;code:&lt;/U&gt;&lt;/P&gt;
&lt;DIV&gt;%MACRO getdata(file=);&lt;/DIV&gt;
&lt;DIV&gt;DATA a&amp;amp;file;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp;INFILE &amp;nbsp;"G:\Departments\Research\test scores\SAT\&amp;amp;year.\&amp;amp;file..txt" truncover lrecl=2601;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp;INPUT &amp;nbsp;schcode $1-6 cohort_year $59-62 last $113-147 first $148-182 mi $183 sex $184 ethnic $201-202 dobchar $203-212 student_id $234-263 gradyr $635-638&amp;nbsp;gradmon $640-641 graddate $635-641 testyr $659-662 testmon $664-665 testday $667-668 testdate $659-668 gr $669-670 total_rd 672-675 eb_read_write_sect_rd 676-678&amp;nbsp;math_sect_rd 679-681 read_rd 682-683 writ_lang_rd 684-685 math_rd 686-689 science_rd 690-691 socstud_rd 692-693 words_context_sub_rd 694-695 evidence_sub_rd 696-697&lt;/DIV&gt;
&lt;DIV&gt;expr_ideas_sub_rd 698-699 eng_conv_sub_rd 700-701 algebra_sub_rd 702-703 adv_math_sub_rd 704-705 prob_data_analysis_sub_rd 706-707 essay_read_sub_rd 708&amp;nbsp;essay_analysis_sub_rd 709 essay_writ_sub_rd 710 gpa $1912-1913 yrsart $1933-1935 yrseng $1936-1938 yrslang $1939-1941 yrsmath $1942-1944 yrssci $1945-1947&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;yrssoc $1948-1950 activ $2131 sports $2202 @1 line $char2601.;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &lt;FONT color="#FF0000"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;SPAN&gt;*** DEFINE SCHOOL. ***;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#FF0000"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;school=put(schcode,actfmt.);&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#FF0000"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;*** DEFINE DOB. ***;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#FF0000"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;dob=input(dobchar,yymmdd10.); &amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;RUN;&lt;/DIV&gt;
&lt;DIV&gt;%MEND;&lt;/DIV&gt;
&lt;DIV&gt;%getdata(file=104268_SAT_&lt;WBR /&gt;20170605_000023);&lt;/DIV&gt;
&lt;DIV&gt;%getdata(&lt;WBR /&gt;file=104268_SAT_20170620_&lt;WBR /&gt;000024);&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;DATA one;&lt;/DIV&gt;
&lt;DIV&gt;SET a104268_SAT_20170630_000025&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; a104268_SAT_20170605_000023 ;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#FF0000"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;*** DEFINE RECORD NUMBER. ***;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT color="#FF0000"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;recnum=_n_;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;run;&lt;/DIV&gt;
&lt;DIV&gt;proc print data=one;&lt;/DIV&gt;
&lt;DIV&gt;run;&lt;/DIV&gt;</description>
      <pubDate>Mon, 18 Sep 2017 20:27:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-help-defined-variables-are-all-missing/m-p/396929#M95889</guid>
      <dc:creator>GreggB</dc:creator>
      <dc:date>2017-09-18T20:27:22Z</dc:date>
    </item>
    <item>
      <title>Re: Macro help - defined variables are all missing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-help-defined-variables-are-all-missing/m-p/396934#M95891</link>
      <description>&lt;P&gt;You NEED to format that code to make it legible...if we can't read it, it's harder to debug.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's also not clear what your issue is.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Sep 2017 20:01:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-help-defined-variables-are-all-missing/m-p/396934#M95891</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-09-18T20:01:49Z</dc:date>
    </item>
    <item>
      <title>Re: Macro help - defined variables are all missing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-help-defined-variables-are-all-missing/m-p/396942#M95893</link>
      <description>&lt;P&gt;How could the code to create SCHOOL possibly have worked fine?&amp;nbsp; The formula expresses a character variable (SCHCODE) using a numeric format (ACTFMT.)?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We'll need to see the log, and possibly a few examples of data values.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Sep 2017 20:11:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-help-defined-variables-are-all-missing/m-p/396942#M95893</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-09-18T20:11:36Z</dc:date>
    </item>
    <item>
      <title>Re: Macro help - defined variables are all missing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-help-defined-variables-are-all-missing/m-p/396946#M95894</link>
      <description>&lt;P&gt;"fine" was the wrong word. It ran without errors. I'm correcting the schcode format issue.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Sep 2017 20:16:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-help-defined-variables-are-all-missing/m-p/396946#M95894</guid>
      <dc:creator>GreggB</dc:creator>
      <dc:date>2017-09-18T20:16:07Z</dc:date>
    </item>
    <item>
      <title>Re: Macro help - defined variables are all missing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-help-defined-variables-are-all-missing/m-p/396953#M95895</link>
      <description>&lt;P&gt;The network drive just went down so that's all of the fun for today.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Sep 2017 20:24:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-help-defined-variables-are-all-missing/m-p/396953#M95895</guid>
      <dc:creator>GreggB</dc:creator>
      <dc:date>2017-09-18T20:24:03Z</dc:date>
    </item>
    <item>
      <title>Re: Macro help - defined variables are all missing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-help-defined-variables-are-all-missing/m-p/396954#M95896</link>
      <description>&lt;P&gt;My issue is that the variables dob, school and recnum are missing for all observations when I open "one" in work.library. When&amp;nbsp;I submit PROC PRINT DATA=ONE the values for dob, school and recnum are there.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need these variables in a subsequent step in order to do some matching.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Sep 2017 20:32:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-help-defined-variables-are-all-missing/m-p/396954#M95896</guid>
      <dc:creator>GreggB</dc:creator>
      <dc:date>2017-09-18T20:32:39Z</dc:date>
    </item>
    <item>
      <title>Re: Macro help - defined variables are all missing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-help-defined-variables-are-all-missing/m-p/396955#M95897</link>
      <description>&lt;P&gt;Are you sure they're missing for all, or just the first few records?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are all the text files in the same folder and are you importing all files in that folder?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Sep 2017 20:34:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-help-defined-variables-are-all-missing/m-p/396955#M95897</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-09-18T20:34:16Z</dc:date>
    </item>
    <item>
      <title>Re: Macro help - defined variables are all missing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-help-defined-variables-are-all-missing/m-p/396966#M95900</link>
      <description>&lt;P&gt;It may help to show the LOG for the macro reading the data with options mprint; set. Paste the code and any messages into a codebox using the forum {i} menu icon to preserve formatting.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Show some values of DOBCHAR where the DOB is missing. (Probably wouldn't hurt to provide a format for DOB like date9 or mmddyy10)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13712"&gt;@GreggB&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;My issue is that the variables dob, school and recnum are missing for all observations when I open "one" in work.library. When&amp;nbsp;I submit PROC PRINT DATA=ONE the values for dob, school and recnum are there.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need these variables in a subsequent step in order to do some matching.&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;How do you "open "one" in work.library"? Perhaps you just aren't scrolling far enough to the right to see the columns?&lt;/P&gt;</description>
      <pubDate>Mon, 18 Sep 2017 21:04:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-help-defined-variables-are-all-missing/m-p/396966#M95900</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-09-18T21:04:41Z</dc:date>
    </item>
    <item>
      <title>Re: Macro help - defined variables are all missing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-help-defined-variables-are-all-missing/m-p/396998#M95914</link>
      <description>&lt;P&gt;Looking at this statements....&lt;/P&gt;&lt;DIV&gt;%MACRO getdata(file=);&lt;/DIV&gt;&lt;DIV&gt;DATA a&amp;amp;file;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp;INFILE &amp;nbsp;"G:\Departments\Research\test scores\SAT\&amp;amp;year.\&amp;amp;file..txt" truncover lrecl=2601;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;#1 You have 2 macro variables YEAR and FILE.&lt;/DIV&gt;&lt;DIV&gt;#2. Macro variable is explicit in your macro statement.&lt;/DIV&gt;&lt;DIV&gt;#3. The macro YEAR i do not know where you defined this.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Better check the log,&amp;nbsp;and locate the WARNING: Apparent symbolic reference YEAR not resolved.&lt;/DIV&gt;</description>
      <pubDate>Tue, 19 Sep 2017 01:09:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-help-defined-variables-are-all-missing/m-p/396998#M95914</guid>
      <dc:creator>ShiroAmada</dc:creator>
      <dc:date>2017-09-19T01:09:36Z</dc:date>
    </item>
    <item>
      <title>Re: Macro help - defined variables are all missing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-help-defined-variables-are-all-missing/m-p/397093#M95936</link>
      <description>&lt;P&gt;This was much ado about nothing on my part. I deleted&amp;nbsp;&lt;SPAN&gt;@1 line $char2601.; from the INPUT statement. I think the length of it was obstructing my view of the vars in question.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Sep 2017 12:38:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-help-defined-variables-are-all-missing/m-p/397093#M95936</guid>
      <dc:creator>GreggB</dc:creator>
      <dc:date>2017-09-19T12:38:18Z</dc:date>
    </item>
    <item>
      <title>Re: Macro help - defined variables are all missing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-help-defined-variables-are-all-missing/m-p/397094#M95937</link>
      <description>&lt;P&gt;&lt;SPAN&gt;This was much ado about nothing on my part. I deleted&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;@1 line $char2601.; from the INPUT statement. I think the length of it was obstructing my view of the vars in question.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Sep 2017 12:39:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-help-defined-variables-are-all-missing/m-p/397094#M95937</guid>
      <dc:creator>GreggB</dc:creator>
      <dc:date>2017-09-19T12:39:13Z</dc:date>
    </item>
  </channel>
</rss>

