<?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: How to reference a local variable that is part of a FILE statement in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/How-to-reference-a-local-variable-that-is-part-of-a-FILE/m-p/518930#M3676</link>
    <description>Thank you Reeza!&lt;BR /&gt;JackieO&lt;BR /&gt;</description>
    <pubDate>Wed, 05 Dec 2018 20:16:39 GMT</pubDate>
    <dc:creator>JackieO</dc:creator>
    <dc:date>2018-12-05T20:16:39Z</dc:date>
    <item>
      <title>How to reference a local variable that is part of a FILE statement</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-reference-a-local-variable-that-is-part-of-a-FILE/m-p/518483#M3558</link>
      <description>&lt;P&gt;I have tried double quotes, single quotes and ampersand.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the following local variable:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; setUpDirFilename = '/uds/data/newdata/20102011/SUM/'||setUpInstDir||'/'setUpFilename;&lt;/P&gt;&lt;P&gt;When I display the contents of this variable I see '/uds/data/newdata/20102011/SUM/I110/110sum1011'.&amp;nbsp; Have tried to use this variable in a FILE statement so that I can write records out to it.&amp;nbsp; No luck no matter what I have tried.&amp;nbsp; Please help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;JackieO&lt;/P&gt;</description>
      <pubDate>Tue, 04 Dec 2018 16:53:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-reference-a-local-variable-that-is-part-of-a-FILE/m-p/518483#M3558</guid>
      <dc:creator>JackieO</dc:creator>
      <dc:date>2018-12-04T16:53:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to reference a local variable that is part of a FILE statement</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-reference-a-local-variable-that-is-part-of-a-FILE/m-p/518493#M3560</link>
      <description>How did you set up the 'local' variable. I suspect what you're trying to do here doesn't make sense from a SAS perspective. Variables only exist in a data step, so did you create a macro variable? Can you show the full code of what you did so we can better understand what you're trying to do?&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 04 Dec 2018 17:06:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-reference-a-local-variable-that-is-part-of-a-FILE/m-p/518493#M3560</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-12-04T17:06:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to reference a local variable that is part of a FILE statement</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-reference-a-local-variable-that-is-part-of-a-FILE/m-p/518498#M3562</link>
      <description>I have never really used macros before, but did also give it a try. I also tried to use '%let', but probably got the syntax wrong or something.&lt;BR /&gt;Within a data step is have created these three variables and one macro(I believe):&lt;BR /&gt;setUpFilename = inst_code||'sum110s.dat';&lt;BR /&gt;setUpInstDir = 'I'||inst_code;&lt;BR /&gt;setUpDirFilename = '/uds/data/newdata/20102011/SUM/'||setUpInstDir||'/'setupFilename;&lt;BR /&gt;%let filename = setUpDirFilename;&lt;BR /&gt;I have to tried to establish a FILE statement in several failing ways:&lt;BR /&gt;FILE "&amp;amp;filename";&lt;BR /&gt;FILE 'setUpDirFilename";&lt;BR /&gt;FILE "setUpDirFilename";&lt;BR /&gt;FILE '&amp;amp;setUpDirFilename';&lt;BR /&gt;Kind of frustrated at this point. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;JackieO&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 04 Dec 2018 17:17:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-reference-a-local-variable-that-is-part-of-a-FILE/m-p/518498#M3562</guid>
      <dc:creator>JackieO</dc:creator>
      <dc:date>2018-12-04T17:17:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to reference a local variable that is part of a FILE statement</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-reference-a-local-variable-that-is-part-of-a-FILE/m-p/518506#M3565</link>
      <description>&lt;P&gt;Ok, so variables are not available outside of the data step.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You're mixing data step logic from a data set here and macro logic for one. Can you please post your full code within the data step? I'm assuming you're trying to create multiple filenames? Is this to read in or export files out?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are two ways to create a filename, note you're missing the fileref, myFile.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename myFile 'path to file';&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you can explain a bit more about what you're trying to do, I can suggest the correct approach.&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>Tue, 04 Dec 2018 17:43:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-reference-a-local-variable-that-is-part-of-a-FILE/m-p/518506#M3565</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-12-04T17:43:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to reference a local variable that is part of a FILE statement</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-reference-a-local-variable-that-is-part-of-a-FILE/m-p/518511#M3569</link>
      <description>Here's my code:&lt;BR /&gt;************************************************************************************************&lt;BR /&gt;* *&lt;BR /&gt;* PROGRAM: SOCIAL_SECURITY_NUMBER_CHANGES.sas *&lt;BR /&gt;* AUTHOR: JACKIE F. ORAM *&lt;BR /&gt;* DATE: NOVEMBER 16, 2018 *&lt;BR /&gt;* *&lt;BR /&gt;* PURPOSE: TO FIND GAYLES TABLE SSN_CROSSOVER SSNS IN OEIS.STUDENT_RECORD. *&lt;BR /&gt;* *&lt;BR /&gt;***********************************************************************************************;&lt;BR /&gt;&lt;BR /&gt;OPTIONS symbolgen;&lt;BR /&gt;&lt;BR /&gt;%INCLUDE '/uds/sas/copylib/orapwd.sas';&lt;BR /&gt;&lt;BR /&gt;LIBNAME oeis ORACLE USER=jackie PASSWORD="&amp;amp;encr1" PATH=oeis_dev;&lt;BR /&gt;&lt;BR /&gt;************************************************************************************************&lt;BR /&gt;* *&lt;BR /&gt;* ACCESS ORACLE TABLE jackie.social_security_corrections TO DEGERMINE INST BEING UPDATED. *&lt;BR /&gt;* a. institution_code *&lt;BR /&gt;* *&lt;BR /&gt;***********************************************************************************************;&lt;BR /&gt;&lt;BR /&gt;PROC SQL;&lt;BR /&gt;CONNECT TO ORACLE (USER=jackie ORAPW="&amp;amp;encr1" PATH=oeis_dev);&lt;BR /&gt;CREATE TABLE inst_list AS&lt;BR /&gt;SELECT * FROM CONNECTION TO ORACLE&lt;BR /&gt;(SELECT DISTINCT institution_code&lt;BR /&gt;FROM jackie.social_security_corrections&lt;BR /&gt;WHERE comments &amp;lt;&amp;gt; 'CORRECTED');&lt;BR /&gt;DISCONNECT FROM ORACLE;&lt;BR /&gt;QUIT;&lt;BR /&gt;&lt;BR /&gt;PROC SORT DATA = inst_list;&lt;BR /&gt;BY institution_code;&lt;BR /&gt;&lt;BR /&gt;DATA setUpList;&lt;BR /&gt;START: SET inst_list END = FINAL;&lt;BR /&gt;BY institution_code;&lt;BR /&gt;FILE '/uds/tmp/jotemp60.txt' PAD LRECL = 250;&lt;BR /&gt;inst_code = ' ';&lt;BR /&gt;ssn09 = ' ';&lt;BR /&gt;sortcode = ' ';&lt;BR /&gt;inst_code = institution_code;&lt;BR /&gt;sortcode = 'A';&lt;BR /&gt;PUT @1 inst_code&lt;BR /&gt;@4 ssn09&lt;BR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/83330"&gt;@13&lt;/a&gt; sortcode;&lt;BR /&gt;IF NOT FINAL THEN GOTO START;&lt;BR /&gt;STOP;&lt;BR /&gt;&lt;BR /&gt;DATA inst_list2;&lt;BR /&gt;INFILE '/uds/tmp/jotemp60.txt' PAD LRECL = 250;&lt;BR /&gt;INPUT inst_code $ 1-3&lt;BR /&gt;ssn09 $ 4-12&lt;BR /&gt;sortcode $ 13;&lt;BR /&gt;&lt;BR /&gt;PROC SORT DATA = inst_list2;&lt;BR /&gt;BY inst_code ssn09 sortcode;&lt;BR /&gt;&lt;BR /&gt;************************************************************************************************&lt;BR /&gt;* *&lt;BR /&gt;* ACCESS ORACLE TABLE jackie.social_security_corrections. *&lt;BR /&gt;* a. original_ssn *&lt;BR /&gt;* b. institution_code *&lt;BR /&gt;* c. last_name *&lt;BR /&gt;* d. first_name *&lt;BR /&gt;* e. middle_name *&lt;BR /&gt;* f. birthdate *&lt;BR /&gt;* g. gender *&lt;BR /&gt;* h. new_ssn *&lt;BR /&gt;* i. modified_by *&lt;BR /&gt;* j. datetime *&lt;BR /&gt;* *&lt;BR /&gt;***********************************************************************************************;&lt;BR /&gt;&lt;BR /&gt;PROC SQL;&lt;BR /&gt;CONNECT TO ORACLE (USER=jackie ORAPW="&amp;amp;encr1" PATH=oeis_dev);&lt;BR /&gt;CREATE TABLE ssn_updates AS&lt;BR /&gt;SELECT * FROM CONNECTION TO ORACLE&lt;BR /&gt;(SELECT institution_code AS inst_code,&lt;BR /&gt;original_ssn AS ssn09,&lt;BR /&gt;new_ssn,&lt;BR /&gt;last_name,&lt;BR /&gt;first_name,&lt;BR /&gt;middle_name,&lt;BR /&gt;birthdate,&lt;BR /&gt;gender,&lt;BR /&gt;'B' AS sortcode&lt;BR /&gt;FROM jackie.social_security_corrections);&lt;BR /&gt;DISCONNECT FROM ORACLE;&lt;BR /&gt;QUIT;&lt;BR /&gt;&lt;BR /&gt;PROC SORT DATA = ssn_updates;&lt;BR /&gt;BY inst_code ssn09 sortcode;&lt;BR /&gt;&lt;BR /&gt;************************************************************************************************&lt;BR /&gt;* *&lt;BR /&gt;* ACADEMIC_YEAR = '20102011' *&lt;BR /&gt;* SEMESTER = 'SUMMER' *&lt;BR /&gt;* *&lt;BR /&gt;***********************************************************************************************;&lt;BR /&gt;&lt;BR /&gt;************************************************************************************************&lt;BR /&gt;* *&lt;BR /&gt;* APPEND CURRENT "I" FILES FOR DEMOGRAPHIC RECORD S. *&lt;BR /&gt;* *&lt;BR /&gt;***********************************************************************************************;&lt;BR /&gt;&lt;BR /&gt;DATA READ_S1_1011;&lt;BR /&gt;FILENAME S1_1011 ('/uds/data/UDSS1011/SUM/I110_S'&lt;BR /&gt;'/uds/data/UDSS1011/SUM/I111_S'&lt;BR /&gt;'/uds/data/UDSS1011/SUM/I120_S'&lt;BR /&gt;'/uds/data/UDSS1011/SUM/I121_S'&lt;BR /&gt;'/uds/data/UDSS1011/SUM/I122_S'&lt;BR /&gt;'/uds/data/UDSS1011/SUM/I123_S'&lt;BR /&gt;'/uds/data/UDSS1011/SUM/I124_S'&lt;BR /&gt;'/uds/data/UDSS1011/SUM/I125_S'&lt;BR /&gt;'/uds/data/UDSS1011/SUM/I130_S'&lt;BR /&gt;'/uds/data/UDSS1011/SUM/I131_S'&lt;BR /&gt;'/uds/data/UDSS1011/SUM/I132_S'&lt;BR /&gt;'/uds/data/UDSS1011/SUM/I133_S'&lt;BR /&gt;'/uds/data/UDSS1011/SUM/I140_S'&lt;BR /&gt;'/uds/data/UDSS1011/SUM/I141_S'&lt;BR /&gt;'/uds/data/UDSS1011/SUM/I142_S'&lt;BR /&gt;'/uds/data/UDSS1011/SUM/I143_S'&lt;BR /&gt;'/uds/data/UDSS1011/SUM/I144_S'&lt;BR /&gt;'/uds/data/UDSS1011/SUM/I145_S'&lt;BR /&gt;'/uds/data/UDSS1011/SUM/I146_S'&lt;BR /&gt;'/uds/data/UDSS1011/SUM/I150_S'&lt;BR /&gt;'/uds/data/UDSS1011/SUM/I151_S'&lt;BR /&gt;'/uds/data/UDSS1011/SUM/I160_S'&lt;BR /&gt;'/uds/data/UDSS1011/SUM/I161_S'&lt;BR /&gt;'/uds/data/UDSS1011/SUM/I162_S'&lt;BR /&gt;'/uds/data/UDSS1011/SUM/I163_S'&lt;BR /&gt;'/uds/data/UDSS1011/SUM/I240_S'&lt;BR /&gt;'/uds/data/UDSS1011/SUM/I241_S'&lt;BR /&gt;'/uds/data/UDSS1011/SUM/I242_S'&lt;BR /&gt;'/uds/data/UDSS1011/SUM/I244_S'&lt;BR /&gt;'/uds/data/UDSS1011/SUM/I245_S'&lt;BR /&gt;'/uds/data/UDSS1011/SUM/I246_S'&lt;BR /&gt;'/uds/data/UDSS1011/SUM/I310_S'&lt;BR /&gt;'/uds/data/UDSS1011/SUM/I321_S'&lt;BR /&gt;'/uds/data/UDSS1011/SUM/I330_S'&lt;BR /&gt;'/uds/data/UDSS1011/SUM/I332_S'&lt;BR /&gt;'/uds/data/UDSS1011/SUM/I337_S');&lt;BR /&gt;INFILE S1_1011 PAD LRECL = 250;&lt;BR /&gt;%INCLUDE '/uds/sas/copylib/UDS_RECORD_S_LAYOUT_OLD';&lt;BR /&gt;sortcode = ' ';&lt;BR /&gt;sortcode = 'C';&lt;BR /&gt;&lt;BR /&gt;PROC SORT DATA = READ_S1_1011;&lt;BR /&gt;BY inst_code ssn09 sortcode;&lt;BR /&gt;&lt;BR /&gt;DATA CHANGE_S1_1011;&lt;BR /&gt;blanks25 = ' ';&lt;BR /&gt;blanks28 = ' ';&lt;BR /&gt;blanks63 = ' ';&lt;BR /&gt;process_inst = ' ';&lt;BR /&gt;foundChange = ' ';&lt;BR /&gt;setUpFilename = blanks28;&lt;BR /&gt;setUpInstDir = ' ';&lt;BR /&gt;setUpDirFilename = blanks63;&lt;BR /&gt;START: SET inst_list2 ssn_updates READ_S1_1011 END = FINAL;&lt;BR /&gt;BY inst_code ssn09 sortcode;&lt;BR /&gt;IF FIRST.inst_code THEN DO;&lt;BR /&gt;process_inst = 'N';&lt;BR /&gt;foundChange = 'N';&lt;BR /&gt;IF sortcode = 'A' THEN DO;&lt;BR /&gt;process_inst = 'Y';&lt;BR /&gt;setUpFilename = inst_code||'sum1011s_ssn_changes.dat';&lt;BR /&gt;setUpInstDir = 'I'||inst_code;&lt;BR /&gt;setUpDirFilename = '/uds/data/newdata/20102011/SUM/'||setUpInstDir||'/'||setUpFilename;&lt;BR /&gt;%let fileName = setUpDirFilename;&lt;BR /&gt;END;&lt;BR /&gt;END;&lt;BR /&gt;IF FIRST.ssn09 THEN DO;&lt;BR /&gt;foundChange = 'N';&lt;BR /&gt;hold_new_ssn = ' ';&lt;BR /&gt;T_last_name = blanks25;&lt;BR /&gt;T_first_name = blanks25;&lt;BR /&gt;T_middle_name = blanks25;&lt;BR /&gt;T_birthdate = ' ';&lt;BR /&gt;T_gender = ' ';&lt;BR /&gt;IF sortcode = 'B' THEN DO;&lt;BR /&gt;foundChange = 'Y';&lt;BR /&gt;T_last_name = last_name;&lt;BR /&gt;T_first_name = first_name;&lt;BR /&gt;T_middle_name = middle_name;&lt;BR /&gt;T_birthdate = birthdate;&lt;BR /&gt;T_gender = gender;&lt;BR /&gt;IF new_ssn &amp;gt; '' THEN hold_new_ssn = new_ssn;&lt;BR /&gt;END;&lt;BR /&gt;END;&lt;BR /&gt;IF process_inst = 'Y' THEN DO;&lt;BR /&gt;IF sortcode = 'C' THEN DO;&lt;BR /&gt;IF foundChange = 'Y' THEN DO;&lt;BR /&gt;FILE '/uds/tmp/jotemp26.txt' PAD LRECL = 80;&lt;BR /&gt;PUT @1 academic_year_8&lt;BR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/145066"&gt;@10&lt;/a&gt; inst_code&lt;BR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/189370"&gt;@14&lt;/a&gt; ssn09&lt;BR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/112798"&gt;@24&lt;/a&gt; hold_new_ssn&lt;BR /&gt;@34 last_name;&lt;BR /&gt;ssn09 = hold_new_ssn;&lt;BR /&gt;END;&lt;BR /&gt;FILE "&amp;amp;fileName" PAD LRECL = 250;&lt;BR /&gt;%INCLUDE '/uds/sas/copylib/PUT_UDS_RECORD_S_LAYOUT';&lt;BR /&gt;END;&lt;BR /&gt;END;&lt;BR /&gt;IF NOT FINAL THEN GOTO START;&lt;BR /&gt;STOP;&lt;BR /&gt;&lt;BR /&gt;Thank you for all your assistance.&lt;BR /&gt;JackieO&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 04 Dec 2018 18:16:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-reference-a-local-variable-that-is-part-of-a-FILE/m-p/518511#M3569</guid>
      <dc:creator>JackieO</dc:creator>
      <dc:date>2018-12-04T18:16:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to reference a local variable that is part of a FILE statement</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-reference-a-local-variable-that-is-part-of-a-FILE/m-p/518584#M3585</link>
      <description>&lt;P&gt;Just based on your shorter post, not on the really long one ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You sort of created a macro variable.&amp;nbsp; It's name is FILENAME and its value is setUpDirFilename.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The %LET statement is not part of the DATA step, and so the value assigned is the actual set of characters "setUpDirFilename".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In a DATA step, if you want to transfer the value of the DATA step variable setUpDirFilename to the macro variable FILENAME, use a different tool:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;call symputx('filename', setUpDirFilename);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When referring to &amp;amp;filename after that DATA step, do not enclose it in single quotes.&amp;nbsp; If you need quotes, use double quotes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One of the examples you have shown is correct:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;file "&amp;amp;filename";&lt;/P&gt;</description>
      <pubDate>Tue, 04 Dec 2018 21:14:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-reference-a-local-variable-that-is-part-of-a-FILE/m-p/518584#M3585</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-12-04T21:14:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to reference a local variable that is part of a FILE statement</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-reference-a-local-variable-that-is-part-of-a-FILE/m-p/518871#M3659</link>
      <description>I am so at a loss here. I think you are saying a macro is a global variable and it must be defined outside of a DATA step. So I have coded a %let FILENAME = setUpDirFilename just before the&lt;BR /&gt;DATA step. You said to use a SYMPUT('FILENAME', setUpDirFilename) inside of this DATA step. This DATA step cycles through data from 46 institutions and makes corrections to SSNs.&lt;BR /&gt;I need one file written for the institutions that require SSN corrections. I originally set up all 46 external files, but many were zero records. So I decided to just structure a file name by the institution&lt;BR /&gt;requiring corrections. I believe you said that I couldn't write to the "structured" filename within the DATA step. I don't know how else to get this accomplished. Sorry to be such a bad "new user",&lt;BR /&gt;but I've never needed to use a macro. Been coding in SAS for 30 plus years. Will you please explain where I am going astray?&lt;BR /&gt;Thank you for all your assistance,&lt;BR /&gt;JackieO&lt;BR /&gt;</description>
      <pubDate>Wed, 05 Dec 2018 17:25:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-reference-a-local-variable-that-is-part-of-a-FILE/m-p/518871#M3659</guid>
      <dc:creator>JackieO</dc:creator>
      <dc:date>2018-12-05T17:25:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to reference a local variable that is part of a FILE statement</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-reference-a-local-variable-that-is-part-of-a-FILE/m-p/518875#M3663</link>
      <description>Whatever approach you're trying to take here is the problem. If you tell us in words what you're trying to do we can help. That would be saying something like: I need to read in x text file so I'm trying to automatically create the file names and then read them in. &lt;BR /&gt;&lt;BR /&gt;Because the code is wrong and I don't know what you're trying to do, it's really hard to make a suggestion on what you should do.</description>
      <pubDate>Wed, 05 Dec 2018 17:38:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-reference-a-local-variable-that-is-part-of-a-FILE/m-p/518875#M3663</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-12-05T17:38:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to reference a local variable that is part of a FILE statement</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-reference-a-local-variable-that-is-part-of-a-FILE/m-p/518877#M3665</link>
      <description>OK. This is my problem:&lt;BR /&gt;&lt;BR /&gt;* We have student data directories structured by academic year, semester and institution code.&lt;BR /&gt;&lt;BR /&gt;* We also have an SSN correction table that has bad SSN, institution code, last name, first name, middle name, birth date and gender data.&lt;BR /&gt;&lt;BR /&gt;* I need to change bad SSN reported between and including 20102011 to present for 46 college campuses.&lt;BR /&gt;&lt;BR /&gt;* The corrected data files (by academic year, semester and institution code) must be written out following our directory structure.&lt;BR /&gt;&lt;BR /&gt;* These files will be processed against our edit application and distributed to various Oracle tables via our ETL process.&lt;BR /&gt;This particular project has never been approached in the 30 plus years that I have worked here. I would truly appreciate your expertise. We are&lt;BR /&gt;on a Unix platform. We currently have SAS94. If I still have not provided you with enough information, I don't know what else I can say.&lt;BR /&gt;JackieO&lt;BR /&gt;</description>
      <pubDate>Wed, 05 Dec 2018 18:03:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-reference-a-local-variable-that-is-part-of-a-FILE/m-p/518877#M3665</guid>
      <dc:creator>JackieO</dc:creator>
      <dc:date>2018-12-05T18:03:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to reference a local variable that is part of a FILE statement</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-reference-a-local-variable-that-is-part-of-a-FILE/m-p/518883#M3666</link>
      <description>Which step above involves the macro variables that you were trying to fix and work with.Is that the part about writing out the files to the correct directory structure?  I'm assuming your process is done up to there?&lt;BR /&gt;&lt;BR /&gt; In general though, I would break this process down further (for myself) and then solve each at a time individually. &lt;BR /&gt;</description>
      <pubDate>Wed, 05 Dec 2018 18:10:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-reference-a-local-variable-that-is-part-of-a-FILE/m-p/518883#M3666</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-12-05T18:10:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to reference a local variable that is part of a FILE statement</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-reference-a-local-variable-that-is-part-of-a-FILE/m-p/518887#M3668</link>
      <description>Yes. Writing out the files. I initially had a LINK WRITE_S statement that wrote out the external files with an IF ELSE IF for all the institutions, but this generated files with zero records. Are you saying to process&lt;BR /&gt;the corrections one institution at a time?&lt;BR /&gt;JackieO&lt;BR /&gt;</description>
      <pubDate>Wed, 05 Dec 2018 18:17:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-reference-a-local-variable-that-is-part-of-a-FILE/m-p/518887#M3668</guid>
      <dc:creator>JackieO</dc:creator>
      <dc:date>2018-12-05T18:17:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to reference a local variable that is part of a FILE statement</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-reference-a-local-variable-that-is-part-of-a-FILE/m-p/518889#M3670</link>
      <description>Not quite sure what 'process the corrections one institution at at time' means. &lt;BR /&gt;&lt;BR /&gt;Do you have the data all in one file? And you want to export that to multiple text files for processing in another system, so it needs to have a specific file structure? &lt;BR /&gt;&lt;BR /&gt;Is the above correct?&lt;BR /&gt;&lt;BR /&gt;If so, that is something that can be easily automated.&lt;BR /&gt;&lt;BR /&gt; Here's the documentation reference: &lt;A href="https://documentation.sas.com/?docsetId=lestmtsref&amp;amp;docsetTarget=n15o12lpyoe4gfn1y1vcp6xs6966.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en#n0m1x5yncfgf4yn16d6ui4h6uinn" target="_blank"&gt;https://documentation.sas.com/?docsetId=lestmtsref&amp;amp;docsetTarget=n15o12lpyoe4gfn1y1vcp6xs6966.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en#n0m1x5yncfgf4yn16d6ui4h6uinn&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;I'll mock up a better example after lunch, if you say this is what you're trying to do.</description>
      <pubDate>Wed, 05 Dec 2018 18:21:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-reference-a-local-variable-that-is-part-of-a-FILE/m-p/518889#M3670</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-12-05T18:21:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to reference a local variable that is part of a FILE statement</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-reference-a-local-variable-that-is-part-of-a-FILE/m-p/518903#M3673</link>
      <description>Hi Reeza!&lt;BR /&gt;I append all the master files for a given academic year, semester and record format (we have S, E, M, D , L and P). So the beginning of the code that I sent to you was appending&lt;BR /&gt;files from 20102011 SUMMER RECORD S. This is how our edit application processes multiple record formats together. The SSN correction table contains multiple&lt;BR /&gt;institutions. I've tried to "flag" the institutions in the correction table and sort them in with the other two files for the DATA step. The written external files&lt;BR /&gt;should be "driven" by the institution flag. The output files should be written out to a similar directory structure so that the original master files are kept safe. Long story short...&lt;BR /&gt;you are correct.&lt;BR /&gt;I looked at Example 5. So this is done outside of a DATA step? I've never done that. I'm really a dinosaur I guess, but I am eager to learn new things. I will play around&lt;BR /&gt;with this and do some Google searching. Please don't give up on me. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;JackieO&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 05 Dec 2018 19:18:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-reference-a-local-variable-that-is-part-of-a-FILE/m-p/518903#M3673</guid>
      <dc:creator>JackieO</dc:creator>
      <dc:date>2018-12-05T19:18:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to reference a local variable that is part of a FILE statement</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-reference-a-local-variable-that-is-part-of-a-FILE/m-p/518929#M3675</link>
      <description>&lt;P&gt;Ok. Here's an example of writing records to a data set within a data step that creates CSV files.&lt;/P&gt;
&lt;P&gt;This writes a single record to each file with the folder having the persons name and the file also having the person's name.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let parent_path = C:\_localdata\temp;

data demo;

*data set to be exported;
set sashelp.class;

*first create directory for folder, assume it doesn't exist;
rc = dcreate(name, "&amp;amp;parent_path");

*create path to file with file name;
out_file_name = catx('\', "&amp;amp;parent_path", name, catt(name, '.csv'));

*file declaration, note fileVAR uses variable created in the data step;
file out filevar=out_file_name dlm=',';

*write header row;
put 'name, age, sex, height, weight';

*write detail row;
put name age sex height weight;

run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;And here's a second, more realistic scenario - create a file for each Sex individually in a folder called M/F with teh file called M/F respectively.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
%let parent_path = C:\_localdata\temp;

proc sort data=sashelp.class out=class;
by sex;
run;

data demo;

*data set to be exported;
set class;
by sex;

*first create directory for folder, assume it doesn't exist;
rc = dcreate(sex, "&amp;amp;parent_path");

*create path to file with file name;
out_file_name = catx('\', "&amp;amp;parent_path", sex, catt(sex, '.csv'));

*file declaration, note fileVAR uses variable created in the data step;
file out filevar=out_file_name dlm=',';

*write header row;
if first.sex then 
	put 'name, age, sex, height, weight';

*write detail row;
put name age sex height weight;

run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I hope that helps clarify what you need to do. Note that in both of these I create a data set, called demo. You can change it to a data _null_ step, once you have it working but I like to leave it as is when testing.&amp;nbsp;&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/249871"&gt;@JackieO&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Hi Reeza!&lt;BR /&gt;I append all the master files for a given academic year, semester and record format (we have S, E, M, D , L and P). So the beginning of the code that I sent to you was appending&lt;BR /&gt;files from 20102011 SUMMER RECORD S. This is how our edit application processes multiple record formats together. The SSN correction table contains multiple&lt;BR /&gt;institutions. I've tried to "flag" the institutions in the correction table and sort them in with the other two files for the DATA step. The written external files&lt;BR /&gt;should be "driven" by the institution flag. The output files should be written out to a similar directory structure so that the original master files are kept safe. Long story short...&lt;BR /&gt;you are correct.&lt;BR /&gt;I looked at Example 5. So this is done outside of a DATA step? I've never done that. I'm really a dinosaur I guess, but I am eager to learn new things. I will play around&lt;BR /&gt;with this and do some Google searching. Please don't give up on me. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;JackieO&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Dec 2018 20:14:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-reference-a-local-variable-that-is-part-of-a-FILE/m-p/518929#M3675</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-12-05T20:14:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to reference a local variable that is part of a FILE statement</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-reference-a-local-variable-that-is-part-of-a-FILE/m-p/518930#M3676</link>
      <description>Thank you Reeza!&lt;BR /&gt;JackieO&lt;BR /&gt;</description>
      <pubDate>Wed, 05 Dec 2018 20:16:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-reference-a-local-variable-that-is-part-of-a-FILE/m-p/518930#M3676</guid>
      <dc:creator>JackieO</dc:creator>
      <dc:date>2018-12-05T20:16:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to reference a local variable that is part of a FILE statement</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-reference-a-local-variable-that-is-part-of-a-FILE/m-p/518942#M3680</link>
      <description>&lt;P&gt;So close and yet so far...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please review my modified code below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;************************************************************************************************&lt;BR /&gt;* *&lt;BR /&gt;* *&lt;BR /&gt;* PROGRAM: SOCIAL_SECURITY_NUMBER_CHANGES.sas *&lt;BR /&gt;* AUTHOR: JACKIE F. ORAM *&lt;BR /&gt;* DATE: NOVEMBER 16, 2018 *&lt;BR /&gt;* *&lt;BR /&gt;* PURPOSE: TO FIND GAYLES TABLE SSN_CROSSOVER SSNS IN OEIS.STUDENT_RECORD. *&lt;BR /&gt;* *&lt;BR /&gt;***********************************************************************************************;&lt;/P&gt;&lt;P&gt;OPTIONS symbolgen;&lt;/P&gt;&lt;P&gt;%INCLUDE '/uds/sas/copylib/orapwd.sas';&lt;/P&gt;&lt;P&gt;LIBNAME oeis ORACLE USER=jackie PASSWORD="&amp;amp;encr1" PATH=oeis_dev;&lt;/P&gt;&lt;P&gt;************************************************************************************************&lt;BR /&gt;* *&lt;BR /&gt;* ACCESS ORACLE TABLE jackie.social_security_corrections TO DEGERMINE INST BEING UPDATED. *&lt;BR /&gt;* a. institution_code *&lt;BR /&gt;* *&lt;BR /&gt;***********************************************************************************************;&lt;/P&gt;&lt;P&gt;PROC SQL;&lt;BR /&gt;CONNECT TO ORACLE (USER=jackie ORAPW="&amp;amp;encr1" PATH=oeis_dev);&lt;BR /&gt;CREATE TABLE inst_list AS&lt;BR /&gt;SELECT * FROM CONNECTION TO ORACLE&lt;BR /&gt;(SELECT DISTINCT institution_code&lt;BR /&gt;FROM jackie.social_security_corrections&lt;BR /&gt;WHERE comments &amp;lt;&amp;gt; 'CORRECTED');&lt;BR /&gt;DISCONNECT FROM ORACLE;&lt;BR /&gt;QUIT;&lt;/P&gt;&lt;P&gt;PROC SORT DATA = inst_list;&lt;BR /&gt;BY institution_code;&lt;/P&gt;&lt;P&gt;DATA setUpList;&lt;BR /&gt;START: SET inst_list END = FINAL;&lt;BR /&gt;BY institution_code;&lt;BR /&gt;FILE '/uds/tmp/jotemp60.txt' PAD LRECL = 250;&lt;BR /&gt;inst_code = ' ';&lt;BR /&gt;ssn09 = ' ';&lt;BR /&gt;sortcode = ' ';&lt;BR /&gt;inst_code = institution_code;&lt;BR /&gt;sortcode = 'A';&lt;BR /&gt;PUT @1 inst_code&lt;BR /&gt;@4 ssn09&lt;BR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/83330"&gt;@13&lt;/a&gt; sortcode;&lt;BR /&gt;IF NOT FINAL THEN GOTO START;&lt;BR /&gt;STOP;&lt;/P&gt;&lt;P&gt;DATA inst_list2;&lt;BR /&gt;INFILE '/uds/tmp/jotemp60.txt' PAD LRECL = 250;&lt;BR /&gt;INPUT inst_code $ 1-3&lt;BR /&gt;ssn09 $ 4-12&lt;BR /&gt;sortcode $ 13;&lt;/P&gt;&lt;P&gt;PROC SORT DATA = inst_list2;&lt;BR /&gt;BY inst_code ssn09 sortcode;&lt;/P&gt;&lt;P&gt;************************************************************************************************&lt;BR /&gt;* *&lt;BR /&gt;* ACCESS ORACLE TABLE jackie.social_security_corrections. *&lt;BR /&gt;* a. original_ssn *&lt;BR /&gt;* b. institution_code *&lt;BR /&gt;* c. last_name *&lt;BR /&gt;* d. first_name *&lt;BR /&gt;* e. middle_name *&lt;BR /&gt;* f. birthdate *&lt;BR /&gt;* g. gender *&lt;BR /&gt;* h. new_ssn *&lt;BR /&gt;* i. modified_by *&lt;BR /&gt;* j. datetime *&lt;BR /&gt;* *&lt;BR /&gt;***********************************************************************************************;&lt;/P&gt;&lt;P&gt;PROC SQL;&lt;BR /&gt;CONNECT TO ORACLE (USER=jackie ORAPW="&amp;amp;encr1" PATH=oeis_dev);&lt;BR /&gt;CREATE TABLE ssn_updates AS&lt;BR /&gt;SELECT * FROM CONNECTION TO ORACLE&lt;BR /&gt;(SELECT institution_code AS inst_code,&lt;BR /&gt;original_ssn AS ssn09,&lt;BR /&gt;new_ssn,&lt;BR /&gt;last_name,&lt;BR /&gt;first_name,&lt;BR /&gt;middle_name,&lt;BR /&gt;birthdate,&lt;BR /&gt;gender,&lt;BR /&gt;'B' AS sortcode&lt;BR /&gt;FROM jackie.social_security_corrections);&lt;BR /&gt;DISCONNECT FROM ORACLE;&lt;BR /&gt;QUIT;&lt;/P&gt;&lt;P&gt;PROC SORT DATA = ssn_updates;&lt;BR /&gt;BY inst_code ssn09 sortcode;&lt;/P&gt;&lt;P&gt;************************************************************************************************&lt;BR /&gt;* *&lt;BR /&gt;* ACADEMIC_YEAR = '20102011' *&lt;BR /&gt;* SEMESTER = 'SUMMER' *&lt;BR /&gt;* *&lt;BR /&gt;***********************************************************************************************;&lt;/P&gt;&lt;P&gt;************************************************************************************************&lt;BR /&gt;* *&lt;BR /&gt;* APPEND CURRENT "I" FILES FOR DEMOGRAPHIC RECORD S. *&lt;BR /&gt;* *&lt;BR /&gt;***********************************************************************************************;&lt;/P&gt;&lt;P&gt;DATA READ_S1_1011;&lt;BR /&gt;FILENAME S1_1011 ('/uds/data/UDSS1011/SUM/I110_S'&lt;BR /&gt;'/uds/data/UDSS1011/SUM/I111_S'&lt;BR /&gt;'/uds/data/UDSS1011/SUM/I120_S'&lt;BR /&gt;'/uds/data/UDSS1011/SUM/I121_S'&lt;BR /&gt;'/uds/data/UDSS1011/SUM/I122_S'&lt;BR /&gt;'/uds/data/UDSS1011/SUM/I123_S'&lt;BR /&gt;'/uds/data/UDSS1011/SUM/I124_S'&lt;BR /&gt;'/uds/data/UDSS1011/SUM/I125_S'&lt;BR /&gt;'/uds/data/UDSS1011/SUM/I130_S'&lt;BR /&gt;'/uds/data/UDSS1011/SUM/I131_S'&lt;BR /&gt;'/uds/data/UDSS1011/SUM/I132_S'&lt;BR /&gt;'/uds/data/UDSS1011/SUM/I133_S'&lt;BR /&gt;'/uds/data/UDSS1011/SUM/I140_S'&lt;BR /&gt;'/uds/data/UDSS1011/SUM/I141_S'&lt;BR /&gt;'/uds/data/UDSS1011/SUM/I142_S'&lt;BR /&gt;'/uds/data/UDSS1011/SUM/I143_S'&lt;BR /&gt;'/uds/data/UDSS1011/SUM/I144_S'&lt;BR /&gt;'/uds/data/UDSS1011/SUM/I145_S'&lt;BR /&gt;'/uds/data/UDSS1011/SUM/I146_S'&lt;BR /&gt;'/uds/data/UDSS1011/SUM/I150_S'&lt;BR /&gt;'/uds/data/UDSS1011/SUM/I151_S'&lt;BR /&gt;'/uds/data/UDSS1011/SUM/I160_S'&lt;BR /&gt;'/uds/data/UDSS1011/SUM/I161_S'&lt;BR /&gt;'/uds/data/UDSS1011/SUM/I162_S'&lt;BR /&gt;'/uds/data/UDSS1011/SUM/I163_S'&lt;BR /&gt;'/uds/data/UDSS1011/SUM/I240_S'&lt;BR /&gt;'/uds/data/UDSS1011/SUM/I241_S'&lt;BR /&gt;'/uds/data/UDSS1011/SUM/I242_S'&lt;BR /&gt;'/uds/data/UDSS1011/SUM/I244_S'&lt;BR /&gt;'/uds/data/UDSS1011/SUM/I245_S'&lt;BR /&gt;'/uds/data/UDSS1011/SUM/I246_S'&lt;BR /&gt;'/uds/data/UDSS1011/SUM/I310_S'&lt;BR /&gt;'/uds/data/UDSS1011/SUM/I321_S'&lt;BR /&gt;'/uds/data/UDSS1011/SUM/I330_S'&lt;BR /&gt;'/uds/data/UDSS1011/SUM/I332_S'&lt;BR /&gt;'/uds/data/UDSS1011/SUM/I337_S');&lt;BR /&gt;INFILE S1_1011 PAD LRECL = 250;&lt;BR /&gt;%INCLUDE '/uds/sas/copylib/UDS_RECORD_S_LAYOUT_OLD';&lt;BR /&gt;sortcode = ' ';&lt;BR /&gt;sortcode = 'C';&lt;/P&gt;&lt;P&gt;PROC SORT DATA = READ_S1_1011;&lt;BR /&gt;BY inst_code ssn09 sortcode;&lt;/P&gt;&lt;P&gt;%let parent_path = /uds/data/newdata/20102011/SUM/I;&lt;/P&gt;&lt;P&gt;DATA CHANGE_S1_1011;&lt;BR /&gt;blanks25 = ' ';&lt;BR /&gt;blanks65 = ' ';&lt;BR /&gt;process_inst = 'N';&lt;BR /&gt;foundChange = 'N';&lt;BR /&gt;fileInst = ' ';&lt;BR /&gt;START: SET inst_list2 ssn_updates READ_S1_1011 END = FINAL;&lt;BR /&gt;BY inst_code ssn09 sortcode;&lt;BR /&gt;IF FIRST.inst_code THEN DO;&lt;BR /&gt;process_inst = 'N';&lt;BR /&gt;foundChange = 'N';&lt;BR /&gt;IF sortcode = 'A' THEN DO;&lt;BR /&gt;process_inst = 'Y';&lt;BR /&gt;fileInst = inst_code;&lt;BR /&gt;rc = dcreate(fileInst, "&amp;amp;parent_path");&lt;BR /&gt;out_file_name = catx('/', "&amp;amp;parent_path", fileInst, catt(fileInst, 'sum1011s_ssn_changes.dat'));&lt;BR /&gt;END;&lt;BR /&gt;END;&lt;BR /&gt;IF FIRST.ssn09 THEN DO;&lt;BR /&gt;foundChange = 'N';&lt;BR /&gt;hold_new_ssn = ' ';&lt;BR /&gt;T_last_name = blanks25;&lt;BR /&gt;T_first_name = blanks25;&lt;BR /&gt;T_middle_name = blanks25;&lt;BR /&gt;T_birthdate = ' ';&lt;BR /&gt;T_gender = ' ';&lt;BR /&gt;IF sortcode = 'B' THEN DO;&lt;BR /&gt;foundChange = 'Y';&lt;BR /&gt;T_last_name = last_name;&lt;BR /&gt;T_first_name = first_name;&lt;BR /&gt;T_middle_name = middle_name;&lt;BR /&gt;T_birthdate = birthdate;&lt;BR /&gt;T_gender = gender;&lt;BR /&gt;IF new_ssn &amp;gt; '' THEN hold_new_ssn = new_ssn;&lt;BR /&gt;END;&lt;BR /&gt;END;&lt;BR /&gt;IF process_inst = 'Y' THEN DO;&lt;BR /&gt;IF sortcode = 'C' THEN DO;&lt;BR /&gt;IF foundChange = 'Y' THEN ssn09 = hold_new_ssn;&lt;BR /&gt;FILE OUT FILEVAR = out_file_name dlm=',';&lt;BR /&gt;END;&lt;BR /&gt;END;&lt;BR /&gt;IF NOT FINAL THEN GOTO START;&lt;BR /&gt;STOP;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;*.log file shows created external file as the following:&lt;/P&gt;&lt;P&gt;ERROR: Physical file does not exist, /uds/data/newdata/20102011/SUM/I/110/110sum1011s_ssn_changes.dat.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Should be /uds/data/newdata/20102011/SUM/I110/110sum1011s_ssn_changes.dat.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope you can see where I went wrong.&lt;/P&gt;&lt;P&gt;Thank you, Reeza!&lt;/P&gt;&lt;P&gt;JackieO&lt;/P&gt;</description>
      <pubDate>Wed, 05 Dec 2018 21:13:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-reference-a-local-variable-that-is-part-of-a-FILE/m-p/518942#M3680</guid>
      <dc:creator>JackieO</dc:creator>
      <dc:date>2018-12-05T21:13:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to reference a local variable that is part of a FILE statement</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-reference-a-local-variable-that-is-part-of-a-FILE/m-p/518943#M3681</link>
      <description>Separate your code please. Which is the step that's generating the error, I don't want to see all the code. Why do you have all those filename statements? Is that for writing out the files? With the process I'm suggesting that isn't required.</description>
      <pubDate>Wed, 05 Dec 2018 21:20:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-reference-a-local-variable-that-is-part-of-a-FILE/m-p/518943#M3681</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-12-05T21:20:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to reference a local variable that is part of a FILE statement</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-reference-a-local-variable-that-is-part-of-a-FILE/m-p/518944#M3682</link>
      <description>Sorry.&lt;BR /&gt;%let parent_path = /uds/data/newdata/20102011/SUM/I;&lt;BR /&gt;&lt;BR /&gt;DATA CHANGE_S1_1011;&lt;BR /&gt;blanks25 = ' ';&lt;BR /&gt;blanks65 = ' ';&lt;BR /&gt;process_inst = 'N';&lt;BR /&gt;foundChange = 'N';&lt;BR /&gt;fileInst = ' ';&lt;BR /&gt;START: SET inst_list2 ssn_updates READ_S1_1011 END = FINAL;&lt;BR /&gt;BY inst_code ssn09 sortcode;&lt;BR /&gt;IF FIRST.inst_code THEN DO;&lt;BR /&gt;process_inst = 'N';&lt;BR /&gt;foundChange = 'N';&lt;BR /&gt;IF sortcode = 'A' THEN DO;&lt;BR /&gt;process_inst = 'Y';&lt;BR /&gt;fileInst = inst_code;&lt;BR /&gt;rc = dcreate(fileInst, "&amp;amp;parent_path");&lt;BR /&gt;out_file_name = catx('/', "&amp;amp;parent_path", fileInst, catt(fileInst, 'sum1011s_ssn_changes.dat'));&lt;BR /&gt;END;&lt;BR /&gt;END;&lt;BR /&gt;IF FIRST.ssn09 THEN DO;&lt;BR /&gt;foundChange = 'N';&lt;BR /&gt;hold_new_ssn = ' ';&lt;BR /&gt;T_last_name = blanks25;&lt;BR /&gt;T_first_name = blanks25;&lt;BR /&gt;T_middle_name = blanks25;&lt;BR /&gt;T_birthdate = ' ';&lt;BR /&gt;T_gender = ' ';&lt;BR /&gt;IF sortcode = 'B' THEN DO;&lt;BR /&gt;foundChange = 'Y';&lt;BR /&gt;T_last_name = last_name;&lt;BR /&gt;T_first_name = first_name;&lt;BR /&gt;T_middle_name = middle_name;&lt;BR /&gt;T_birthdate = birthdate;&lt;BR /&gt;T_gender = gender;&lt;BR /&gt;IF new_ssn &amp;gt; '' THEN hold_new_ssn = new_ssn;&lt;BR /&gt;END;&lt;BR /&gt;END;&lt;BR /&gt;IF process_inst = 'Y' THEN DO;&lt;BR /&gt;IF sortcode = 'C' THEN DO;&lt;BR /&gt;IF foundChange = 'Y' THEN ssn09 = hold_new_ssn;&lt;BR /&gt;FILE OUT FILEVAR = out_file_name dlm=',';&lt;BR /&gt;END;&lt;BR /&gt;END;&lt;BR /&gt;IF NOT FINAL THEN GOTO START;&lt;BR /&gt;STOP;&lt;BR /&gt;JO&lt;BR /&gt;</description>
      <pubDate>Wed, 05 Dec 2018 21:22:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-reference-a-local-variable-that-is-part-of-a-FILE/m-p/518944#M3682</guid>
      <dc:creator>JackieO</dc:creator>
      <dc:date>2018-12-05T21:22:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to reference a local variable that is part of a FILE statement</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-reference-a-local-variable-that-is-part-of-a-FILE/m-p/518945#M3683</link>
      <description>Why do you have START/GOTO in here? What are you using that for? Just want to make sure I understand it correctly?</description>
      <pubDate>Wed, 05 Dec 2018 21:28:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-reference-a-local-variable-that-is-part-of-a-FILE/m-p/518945#M3683</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-12-05T21:28:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to reference a local variable that is part of a FILE statement</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-reference-a-local-variable-that-is-part-of-a-FILE/m-p/518947#M3685</link>
      <description>It is looping through the input data. I know it is old school and probably not still done today.&lt;BR /&gt;JackieO&lt;BR /&gt;</description>
      <pubDate>Wed, 05 Dec 2018 21:29:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-reference-a-local-variable-that-is-part-of-a-FILE/m-p/518947#M3685</guid>
      <dc:creator>JackieO</dc:creator>
      <dc:date>2018-12-05T21:29:39Z</dc:date>
    </item>
  </channel>
</rss>

