<?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: Scan Function for data input in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/Scan-Function-for-data-input/m-p/384784#M3208</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/44100"&gt;@jacksonan123&lt;/a&gt; wrote:&lt;BR /&gt;The current macro that I have runs just fine with the libname and when it is&lt;BR /&gt;removed I get an error.&lt;BR /&gt;&lt;BR /&gt;The libname is being used by SASuniversity for the infile statement.&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Unless the INFILE&amp;nbsp;statement looks like this&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;infile "%sysfunc(pathname(OLD))/TEST&amp;amp;i..smr" truncover;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;then the INFILE statement is in no way using the libname statement for anything.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now your code or your SAS/Studio session might be using the libref OLD for something. &amp;nbsp;But since its definition does NOT depend on the macro variables used in the macro there is no reason why it cannot be defined outside of the macro. &amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname OLD "/folders/myfolders/bootprocess/";
%datm1;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or if it is defined in the macro then define it outside of the %DO loop instead of defining it twice.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro datm1;
libname OLD "/folders/myfolders/bootprocess/";
%do i=1% to 2;
...
%end;
%mend datm1;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 01 Aug 2017 20:06:51 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2017-08-01T20:06:51Z</dc:date>
    <item>
      <title>Scan Function for data input</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Scan-Function-for-data-input/m-p/384621#M3192</link>
      <description>&lt;P&gt;I have the following code to scan the input from my files test1.txt and test2.txt using SAS University edition.&amp;nbsp; I have also placed it in the question using the SAS icon.&lt;/P&gt;&lt;PRE&gt;&amp;nbsp;&lt;/PRE&gt;&lt;PRE&gt;%macro datm1;&lt;BR /&gt;%do i=1% to 2;&lt;BR /&gt;data NEW&amp;amp;i;&lt;BR /&gt;libname OLD "/folders/myfolders/bootprocess/";&lt;BR /&gt;/*Input D*/&lt;BR /&gt;datafile="/folders/myfolders/bootprocess/TEST&amp;amp;i..DAT/";&lt;BR /&gt;INPUT @ 1 CHECK  $CHAR200.@;&lt;BR /&gt;/*DATA NAME IS CHECK WHICH IS INDEXED W/'THETA   =' THIS MUST BE EXACT*/&lt;BR /&gt;S=INDEX(CHECK,'THETA     =');&lt;BR /&gt;/*DO LOOP TO PICK OUT CORRECT LINE OF CODE LINE W/STRING WILL BE NUMBERED WITH 1 OTHERS=0*/&lt;BR /&gt;/*SCAN FUNCTION ALLOWS VARIABLES TO BE OUTPUT FROM THAT POSITION WITH THE DESIRED NAME*/&lt;BR /&gt;IF S&amp;gt;0 THEN DO;&lt;BR /&gt; THETA_=SUBSTR(CHECK,S+0,110);&lt;BR /&gt; K13=SCAN(THETA_,1,' ');&lt;BR /&gt; K23=SCAN(THETA_,2,' ');&lt;BR /&gt; DURATION=SCAN(THETA_,3,' ');&lt;BR /&gt; LAG=SCAN(THETA_,4,' ');&lt;BR /&gt; LOGIT=SCAN(THETA_,5,' ');&lt;BR /&gt; K30  =SCAN(THETA_,6,' ');&lt;BR /&gt; K34= SCAN(THETA_,7,'   ');&lt;BR /&gt; VOLUME=SCAN(THETA_,8,'  ');&lt;BR /&gt;  OUTPUT;&lt;BR /&gt; END;&lt;BR /&gt;PUT  K13  K23 DURATION LAG LOGIT K30 K34 VOLUME; &lt;BR /&gt;KEEP  K13  K23 DURATION LAG LOGIT K30 K34 VOLUME;&lt;BR /&gt; *PROC PRINT;&lt;BR /&gt;RUN;&lt;BR /&gt;&lt;BR /&gt;dATA PEW;&lt;BR /&gt;SET NEW;&lt;BR /&gt;PROC PRINT;&lt;BR /&gt;RUN;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;When I run the code I get no output but an error 49 which states " The meaning of an identifier after a quoted string might change in a future SAS release. Inserting white space between a quoted string and the succeeding identifier is recommended."&amp;nbsp; I really habe no idea what this means.&amp;nbsp; Can anyone tell me what is the problem and how I can solve it?&amp;nbsp; The data sets test1 and test 2 are the same.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Aug 2017 14:20:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Scan-Function-for-data-input/m-p/384621#M3192</guid>
      <dc:creator>jacksonan123</dc:creator>
      <dc:date>2017-08-01T14:20:49Z</dc:date>
    </item>
    <item>
      <title>Re: Scan Function for data input</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Scan-Function-for-data-input/m-p/384632#M3193</link>
      <description>&lt;P&gt;You need to show us more! You create a macro, but don't show how it ends (i.e., a %mend; statement), you start a %do loop (the % to may or may not work .. should be %to), but I didn't see a %end statement, you create new1 and new2, but then try to print new, and you use a datafile statement (which I've never seen before) where you probably want to use an infile statement, your libname and datafile statements end with / which might be ok for the libname (but not needed), but I don't think will work with the infile statement, and, finally, you never show us an example dataset or show us the statement that calls the macro.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Aug 2017 14:48:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Scan-Function-for-data-input/m-p/384632#M3193</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-08-01T14:48:32Z</dc:date>
    </item>
    <item>
      <title>Re: Scan Function for data input</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Scan-Function-for-data-input/m-p/384633#M3194</link>
      <description>I apologize but I did forget to post the entire program. It is now&lt;BR /&gt;attached.&lt;BR /&gt;&lt;BR /&gt;%macro datm1;&lt;BR /&gt;%do i=1% to 2;&lt;BR /&gt;data NEW&amp;amp;i;&lt;BR /&gt;libname OLD "/folders/myfolders/bootprocess/";&lt;BR /&gt;/*Input D*/&lt;BR /&gt;datafile="/folders/myfolders/bootprocess/TEST&amp;amp;i..smr/";&lt;BR /&gt;INPUT @ 1 CHECK $CHAR200.@;&lt;BR /&gt;/*DATA NAME IS CHECK WHICH IS INDEXED W/'THETA =' THIS MUST BE EXACT*/&lt;BR /&gt;S=INDEX(CHECK,'THETA =');&lt;BR /&gt;/*DO LOOP TO PICK OUT CORRECT LINE OF CODE LINE W/STRING WILL BE NUMBERED&lt;BR /&gt;WITH 1 OTHERS=0*/&lt;BR /&gt;/*SCAN FUNCTION ALLOWS VARIABLES TO BE OUTPUT FROM THAT POSITION WITH THE&lt;BR /&gt;DESIRED NAME*/&lt;BR /&gt;IF S&amp;gt;0 THEN DO;&lt;BR /&gt;THETA_=SUBSTR(CHECK,S+0,110);&lt;BR /&gt;K13=SCAN(THETA_,1,' ');&lt;BR /&gt;K23=SCAN(THETA_,2,' ');&lt;BR /&gt;DURATION=SCAN(THETA_,3,' ');&lt;BR /&gt;LAG=SCAN(THETA_,4,' ');&lt;BR /&gt;LOGIT=SCAN(THETA_,5,' ');&lt;BR /&gt;K30 =SCAN(THETA_,6,' ');&lt;BR /&gt;K34= SCAN(THETA_,7,' ');&lt;BR /&gt;VOLUME=SCAN(THETA_,8,' ');&lt;BR /&gt;OUTPUT;&lt;BR /&gt;END;&lt;BR /&gt;PUT K13 K23 DURATION LAG LOGIT K30 K34 VOLUME;&lt;BR /&gt;KEEP K13 K23 DURATION LAG LOGIT K30 K34 VOLUME;&lt;BR /&gt;*PROC PRINT;&lt;BR /&gt;RUN;&lt;BR /&gt;&lt;BR /&gt;dATA PEW;&lt;BR /&gt;SET NEW;&lt;BR /&gt;PROC PRINT;&lt;BR /&gt;RUN;&lt;BR /&gt;&lt;BR /&gt;TITLE ' DISTRIBUTION DATA';&lt;BR /&gt;data distrR;&lt;BR /&gt;set %do i=1% to 2;&lt;BR /&gt;new&amp;amp;i %end ;;&lt;BR /&gt;proc append base=master&amp;amp;i data=new&amp;amp;i;&lt;BR /&gt;*PROC PRINT;&lt;BR /&gt;RUN;&lt;BR /&gt;%end;&lt;BR /&gt;%mend datm;&lt;BR /&gt;%datm;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 01 Aug 2017 14:52:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Scan-Function-for-data-input/m-p/384633#M3194</guid>
      <dc:creator>jacksonan123</dc:creator>
      <dc:date>2017-08-01T14:52:39Z</dc:date>
    </item>
    <item>
      <title>Re: Scan Function for data input</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Scan-Function-for-data-input/m-p/384676#M3195</link>
      <description>&lt;P&gt;The following corrects for the errors I mentioned in my first post, as well as a couple of additional problems. NEVER use the * type comment in a macro!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm not sure what you are trying to do, but try and then examine the results of the following code:&lt;/P&gt;
&lt;PRE&gt;%macro datm1;
/*  %do i=1% to 2;*/
  %do i=1 %to 2;
    data NEW&amp;amp;i;
      libname OLD "/folders/myfolders/bootprocess/";
      /*Input D*/

/*      datafile="/folders/myfolders/bootprocess/TEST&amp;amp;i..smr/";*/
      infile "/folders/myfolders/bootprocess/TEST&amp;amp;i..smr" truncover;
/*      INPUT @ 1 CHECK $CHAR200.@;*/
      INPUT @ 1 CHECK $CHAR200.;
      /*DATA NAME IS CHECK WHICH IS INDEXED W/'THETA =' THIS MUST BE EXACT*/
      S=INDEX(CHECK,'THETA     =');
      /*DO LOOP TO PICK OUT CORRECT LINE OF CODE LINE W/STRING WILL BE NUMBERED
      WITH 1 OTHERS=0*/
      /*SCAN FUNCTION ALLOWS VARIABLES TO BE OUTPUT FROM THAT POSITION WITH THE
      DESIRED NAME*/
      IF S&amp;gt;0 THEN DO;
        THETA_=SUBSTR(CHECK,S+0,110);
        K13=SCAN(THETA_,1,' ');
        K23=SCAN(THETA_,2,' ');
        DURATION=SCAN(THETA_,3,' ');
        LAG=SCAN(THETA_,4,' ');
        LOGIT=SCAN(THETA_,5,' ');
        K30 =SCAN(THETA_,6,' ');
        K34= SCAN(THETA_,7,' ');
        VOLUME=SCAN(THETA_,8,' ');
        OUTPUT;
      END;
      PUT K13 K23 DURATION LAG LOGIT K30 K34 VOLUME;
      KEEP K13 K23 DURATION LAG LOGIT K30 K34 VOLUME;
/*      *PROC PRINT;*/
    RUN;

/*    dATA PEW;*/
/*      SET NEW;*/
    PROC PRINT;
    RUN;

    TITLE ' DISTRIBUTION DATA';
/*    data distrR;*/
/*      set %do i=1% to 2;new&amp;amp;i %end ;;*/
    proc append base=master data=new&amp;amp;i;
    /**PROC PRINT;*/
    RUN;
  %end;
/*%mend datm;*/
%mend datm1;
%datm1;
/*run;*/
&lt;/PRE&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Aug 2017 16:39:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Scan-Function-for-data-input/m-p/384676#M3195</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-08-01T16:39:29Z</dc:date>
    </item>
    <item>
      <title>Re: Scan Function for data input</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Scan-Function-for-data-input/m-p/384696#M3199</link>
      <description>Changing the input to (infile=) from (datafile=) and adding truncover&lt;BR /&gt;helped it to run ok.&lt;BR /&gt;&lt;BR /&gt;However a macro issue surfaced. I noted that the following code was&lt;BR /&gt;commented out in your reply:&lt;BR /&gt;&lt;BR /&gt;/* data distrR;*/&lt;BR /&gt;/* set %do i=1% to 2;new&amp;amp;i %end ;;*/&lt;BR /&gt;proc append base=master data=new&amp;amp;i;&lt;BR /&gt;/**PROC PRINT;*/&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I actually need that code because I need the distrR data set to be created&lt;BR /&gt;so that it can be further processed.&lt;BR /&gt;&lt;BR /&gt;When I include the code you commented out I get an error that Work.new3 does&lt;BR /&gt;not exist. Can you tell me why I am getting this error? My macro states 1&lt;BR /&gt;to 2:&lt;BR /&gt;&lt;BR /&gt;data distrR;&lt;BR /&gt;set %do i=1 %to 2;&lt;BR /&gt;new&amp;amp;i %end ;;&lt;BR /&gt;proc append base=master&amp;amp;i data=new&amp;amp;i;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks for your help.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 01 Aug 2017 17:37:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Scan-Function-for-data-input/m-p/384696#M3199</guid>
      <dc:creator>jacksonan123</dc:creator>
      <dc:date>2017-08-01T17:37:39Z</dc:date>
    </item>
    <item>
      <title>Re: Scan Function for data input</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Scan-Function-for-data-input/m-p/384700#M3201</link>
      <description>&lt;P&gt;I commented those lines out because: (1) you were setting&amp;nbsp;the macro variable i in two overlapping loops and it didn't make any sense (to me) to be using an append statement to create two master files that each would only include the files you already created.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You would have to post the code you actually ran but, before doing so, change the second loop to something other than I (e.g., J)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And, if you want to solve it yourself, first run:&lt;/P&gt;
&lt;PRE&gt;options mprint mlogic symbolgen;&lt;/PRE&gt;
&lt;P&gt;That way you will be able to see what is going on in the background throughout the code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;</description>
      <pubDate>Tue, 01 Aug 2017 18:05:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Scan-Function-for-data-input/m-p/384700#M3201</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-08-01T18:05:10Z</dc:date>
    </item>
    <item>
      <title>Re: Scan Function for data input</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Scan-Function-for-data-input/m-p/384712#M3202</link>
      <description>I put in the code to have the notes and mprint printed out and whether I put&lt;BR /&gt;in J or left in the I for the append it seems to have the same issue. It&lt;BR /&gt;looks for a work.new3 which doesn't exist. It went through 1 and 2 with&lt;BR /&gt;no issue but instead of stopping it resolves :&lt;BR /&gt;&lt;BR /&gt;With the following code for the distr data step:&lt;BR /&gt;&lt;BR /&gt;data distrR;&lt;BR /&gt;set %do i=1 %to 2;&lt;BR /&gt;new&amp;amp;i %end ;;&lt;BR /&gt;proc append base=master&amp;amp;i data=new&amp;amp;i;&lt;BR /&gt;*PROC PRINT;&lt;BR /&gt;RUN;&lt;BR /&gt;%end;&lt;BR /&gt;%mend datm1;&lt;BR /&gt;%datm1;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Symbolgen: Macro variable I resolves to 3&lt;BR /&gt;&lt;BR /&gt;Mprint(datm1): proc append base =master3 data=new3&lt;BR /&gt;&lt;BR /&gt;Error: File work,new3 does not exist.&lt;BR /&gt;&lt;BR /&gt;If I put in j:&lt;BR /&gt;&lt;BR /&gt;Symbolgen: Macro variable j resolves to 3&lt;BR /&gt;&lt;BR /&gt;Mprint(datm1): proc append base =master3 data=new3&lt;BR /&gt;&lt;BR /&gt;Error: File work,new3 does not exist.&lt;BR /&gt;&lt;BR /&gt;Can you tell me why the macro does not stop at 2?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 01 Aug 2017 18:39:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Scan-Function-for-data-input/m-p/384712#M3202</guid>
      <dc:creator>jacksonan123</dc:creator>
      <dc:date>2017-08-01T18:39:39Z</dc:date>
    </item>
    <item>
      <title>Re: Scan Function for data input</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Scan-Function-for-data-input/m-p/384727#M3203</link>
      <description>&lt;P&gt;Makes perfect sense .. but the logic of your code doesn't!.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Think about it! You have a major loop where you are creating NEW1 and NEW2. However, in the middle of that loop you are trying to create three copies of the same thing, one called distrR and the other called master1 and master2.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since the I loop doesn't %end until the end of the program, the first time through it can't create distrR the way you want because only one of the files had been created at that point. The loop doesn't end until I gt 2 (i.e., 3), thus that is its value by the time it gets to the proc append statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You'll have to tell us what you really want to create in those two segments (i.e., distrR and master&amp;amp;i) in order for anyone to give you good advice.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;</description>
      <pubDate>Tue, 01 Aug 2017 18:58:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Scan-Function-for-data-input/m-p/384727#M3203</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-08-01T18:58:47Z</dc:date>
    </item>
    <item>
      <title>Re: Scan Function for data input</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Scan-Function-for-data-input/m-p/384755#M3204</link>
      <description>&lt;P&gt;I would suggest taking a step back and getting the data step working for a single file first. Later you can back the macro %DO loop if you need it. &amp;nbsp;It is much easier to debug without having to use macro code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also post an example input file and we can help you simplify the data step. &amp;nbsp;If the data is really space delimited then why not just use the INPUT statement to read it rather than reading it into a character varaible and then having to parse it. Plust that way it will be easier to read the numeric fields into numeric variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Something like this might work.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data new1 ;
  infile "/folders/myfolders/bootprocess/TEST1.DAT";
  input @;
  if index(_infile_ , 'THETA     =') then do;
    input @'THETA     =' +110 THETA K13 K23 DURATION LAG LOGIT K30 K34 VOLUME;
    output;
  end;
run;
data _null_;
  set new1 ;
  put (_all_) (=/);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 01 Aug 2017 19:23:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Scan-Function-for-data-input/m-p/384755#M3204</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-08-01T19:23:19Z</dc:date>
    </item>
    <item>
      <title>Re: Scan Function for data input</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Scan-Function-for-data-input/m-p/384761#M3205</link>
      <description>I got a response that allowed me to use my original code by using an infile&lt;BR /&gt;statement with truncover instead of datafile.&lt;BR /&gt;&lt;BR /&gt;The changed code is listed:&lt;BR /&gt;&lt;BR /&gt;%macro datm1;&lt;BR /&gt;%do i=1 %to 2;&lt;BR /&gt;&lt;BR /&gt;data NEW&amp;amp;i;&lt;BR /&gt;libname OLD "/folders/myfolders/bootprocess/";&lt;BR /&gt;/*Input D*/&lt;BR /&gt;/*datafile="/folders/myfolders/bootprocess/TEST&amp;amp;i..smr/";*/&lt;BR /&gt;infile "/folders/myfolders/bootprocess/TEST&amp;amp;i..smr/" truncover;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks for your response and I will try your code later.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 01 Aug 2017 19:28:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Scan-Function-for-data-input/m-p/384761#M3205</guid>
      <dc:creator>jacksonan123</dc:creator>
      <dc:date>2017-08-01T19:28:39Z</dc:date>
    </item>
    <item>
      <title>Re: Scan Function for data input</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Scan-Function-for-data-input/m-p/384762#M3206</link>
      <description>&lt;P&gt;Why did you still post the start of data step with a LIBNAME statement embedded into the middle of it?&lt;/P&gt;
&lt;P&gt;The LIBNAME statement will have NOTHING to do with the data step. It will be compiled before the data step starts. &amp;nbsp;Plus you code isn't even referencing the libref it creates.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Aug 2017 19:30:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Scan-Function-for-data-input/m-p/384762#M3206</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-08-01T19:30:46Z</dc:date>
    </item>
    <item>
      <title>Re: Scan Function for data input</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Scan-Function-for-data-input/m-p/384775#M3207</link>
      <description>The current macro that I have runs just fine with the libname and when it is&lt;BR /&gt;removed I get an error.&lt;BR /&gt;&lt;BR /&gt;The libname is being used by SASuniversity for the infile statement.&lt;BR /&gt;</description>
      <pubDate>Tue, 01 Aug 2017 19:47:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Scan-Function-for-data-input/m-p/384775#M3207</guid>
      <dc:creator>jacksonan123</dc:creator>
      <dc:date>2017-08-01T19:47:39Z</dc:date>
    </item>
    <item>
      <title>Re: Scan Function for data input</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Scan-Function-for-data-input/m-p/384784#M3208</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/44100"&gt;@jacksonan123&lt;/a&gt; wrote:&lt;BR /&gt;The current macro that I have runs just fine with the libname and when it is&lt;BR /&gt;removed I get an error.&lt;BR /&gt;&lt;BR /&gt;The libname is being used by SASuniversity for the infile statement.&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Unless the INFILE&amp;nbsp;statement looks like this&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;infile "%sysfunc(pathname(OLD))/TEST&amp;amp;i..smr" truncover;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;then the INFILE statement is in no way using the libname statement for anything.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now your code or your SAS/Studio session might be using the libref OLD for something. &amp;nbsp;But since its definition does NOT depend on the macro variables used in the macro there is no reason why it cannot be defined outside of the macro. &amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname OLD "/folders/myfolders/bootprocess/";
%datm1;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or if it is defined in the macro then define it outside of the %DO loop instead of defining it twice.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro datm1;
libname OLD "/folders/myfolders/bootprocess/";
%do i=1% to 2;
...
%end;
%mend datm1;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Aug 2017 20:06:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Scan-Function-for-data-input/m-p/384784#M3208</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-08-01T20:06:51Z</dc:date>
    </item>
    <item>
      <title>Re: Scan Function for data input</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Scan-Function-for-data-input/m-p/384809#M3210</link>
      <description>&lt;P&gt;Looking at your raw data, I will guess that you really want to read some of the other fields in your data. However, the following matches most of the calculations described in the data. This time, I chose to read them directly rather than scanning a text field:&lt;/P&gt;
&lt;PRE&gt;%macro datm1;
  %do i=1 %to 2;
    data NEW&amp;amp;i;
      /*Input D*/
      infile "/folders/myfolders/bootprocess/TEST&amp;amp;i..smr";
      INPUT @ 'THETA     =' K13 K23 CL V3 D1 TLAG2 LOGITT;
      ALAG2=sum(D1,TLAG2);
      TVF1=1/(1+EXP(-LOGITT));
      F1=TVF1;
      S3=V3/1000;
      F2=1-F1;
      K30=CL/V3;
    run;
  %end;

  TITLE ' DISTRIBUTION DATA';
   data distrR;
     set %do i=1 %to 2;new&amp;amp;i %end ;;
   run;
%mend datm1;
%datm1;
&lt;/PRE&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Aug 2017 21:21:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Scan-Function-for-data-input/m-p/384809#M3210</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-08-01T21:21:32Z</dc:date>
    </item>
    <item>
      <title>Re: Scan Function for data input</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Scan-Function-for-data-input/m-p/384830#M3212</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/44100"&gt;@jacksonan123&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;When I run the code I get no output but an error 49 which states "&lt;STRONG&gt; The meaning of an identifier after a quoted string might change&lt;/STRONG&gt; in a future SAS release. Inserting white space between a quoted string and the succeeding identifier is recommended."&amp;nbsp; I really habe no idea what this means.&amp;nbsp; Can anyone tell me what is the problem and how I can solve it?&amp;nbsp; The data sets test1 and test 2 are the same.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If you read carefully that is a WARNING. There aer several code structures, date, datetime, time and name literals that use a quoted value followed immediately by a special character to indicate the quoted value is to be used in a specific way.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;x = '01JAN2017'd; for example says that the variable x is assigned a date value (the trailing d). So if you use code with any quoted string such as: &amp;nbsp;'some string followed by'anything the 'a triggers the generic&amp;nbsp;warning because the character was not one of the currently used d,dt, t, n (and I think there's another couple I don't remember of the top of my head).&lt;/P&gt;
&lt;P&gt;Note that if you had used one of the data indicators you may have generated an error instead:&lt;/P&gt;
&lt;PRE&gt;446  data _null_;
447     x='23Fre2017'd;
          ------------
          77
ERROR: Invalid date/time/datetime constant '23Fre2017'd.
ERROR 77-185: Invalid number conversion on '23Fre2017'd.

448  run;
&lt;/PRE&gt;
&lt;P&gt;because the value in the quotes does not match the type indicated by the trailing character.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Aug 2017 22:34:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Scan-Function-for-data-input/m-p/384830#M3212</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-08-01T22:34:21Z</dc:date>
    </item>
    <item>
      <title>Re: Scan Function for data input</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Scan-Function-for-data-input/m-p/384842#M3214</link>
      <description>&lt;P&gt;Code works well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 02 Aug 2017 00:12:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Scan-Function-for-data-input/m-p/384842#M3214</guid>
      <dc:creator>jacksonan123</dc:creator>
      <dc:date>2017-08-02T00:12:13Z</dc:date>
    </item>
    <item>
      <title>Re: Scan Function for data input</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Scan-Function-for-data-input/m-p/384845#M3215</link>
      <description>The code works well. I had one additional question. In my data output I&lt;BR /&gt;would like to capture the string MINIMIZATION SUCCESSFUL or in some other&lt;BR /&gt;cased MINIMIZATION TERMINATED as part of my output?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;( K13 K23 CL V3 D1 TLAG2 LOGITT MINIMIZATION SUCCESSFUL) or ( k13 k23&lt;BR /&gt;..MINIMIZATION TERMINATED)&lt;BR /&gt;</description>
      <pubDate>Wed, 02 Aug 2017 00:24:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Scan-Function-for-data-input/m-p/384845#M3215</guid>
      <dc:creator>jacksonan123</dc:creator>
      <dc:date>2017-08-02T00:24:39Z</dc:date>
    </item>
    <item>
      <title>Re: Scan Function for data input</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Scan-Function-for-data-input/m-p/450386#M5125</link>
      <description>I know this is old and resolved but just wanted to chip in a bit of "clarity" as to the error &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/44100"&gt;@jacksonan123&lt;/a&gt;? is seeing: if you were to provide the part of the error log where the message is printed there's a good chance theres' some coordinates to point out where those unbalanced quotes maybe are lurking - anybody give this a shot?&lt;BR /&gt;</description>
      <pubDate>Mon, 02 Apr 2018 15:54:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Scan-Function-for-data-input/m-p/450386#M5125</guid>
      <dc:creator>ccaulkins9</dc:creator>
      <dc:date>2018-04-02T15:54:13Z</dc:date>
    </item>
    <item>
      <title>Re: Scan Function for data input</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Scan-Function-for-data-input/m-p/450388#M5127</link>
      <description>in fact, this error actually isn't barely related to SAS Studio, but more like Base SAS related&lt;BR /&gt;</description>
      <pubDate>Mon, 02 Apr 2018 15:54:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Scan-Function-for-data-input/m-p/450388#M5127</guid>
      <dc:creator>ccaulkins9</dc:creator>
      <dc:date>2018-04-02T15:54:51Z</dc:date>
    </item>
  </channel>
</rss>

