<?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: read a dataset within a dataset in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/read-a-dataset-within-a-dataset/m-p/320065#M70421</link>
    <description>&lt;P&gt;From your description, it's not exactly clear which DD statement(s) you already have, and what your data set names are. &amp;nbsp;But there are other ways under MVS to locate a data set, other than coding a DD statement in the JCL. &amp;nbsp;You can have SAS define the libname within the SAS code. &amp;nbsp;Now you need to be able to include the location of the file. &amp;nbsp;If you don't know it, SAS won't know it either.&lt;/P&gt;</description>
    <pubDate>Mon, 19 Dec 2016 23:35:49 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2016-12-19T23:35:49Z</dc:date>
    <item>
      <title>read a dataset within a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/read-a-dataset-within-a-dataset/m-p/320062#M70418</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Its pretty urgent!! So a quick help will be appreciated &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a dataset say : new.file.data&lt;/P&gt;&lt;P&gt;inside this dataset there is only one record which is itself a dataset : edi.batch.one&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to read the inner dataset&amp;nbsp; '&amp;nbsp;edi.batch.one '&amp;nbsp; which is present inside&amp;nbsp; 'new.file.data&amp;nbsp;'&lt;/P&gt;&lt;P&gt;problem : the only physical file name I can provide is for 'new.file.data&amp;nbsp;' and sas doesnt read a file without it being assigned to a dd statement&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Help please&lt;/P&gt;</description>
      <pubDate>Mon, 19 Dec 2016 23:25:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/read-a-dataset-within-a-dataset/m-p/320062#M70418</guid>
      <dc:creator>sayanapex06</dc:creator>
      <dc:date>2016-12-19T23:25:46Z</dc:date>
    </item>
    <item>
      <title>Re: read a dataset within a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/read-a-dataset-within-a-dataset/m-p/320064#M70420</link>
      <description>&lt;P&gt;I'm not sure I follow. If you post a sample it may help.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use filename and other functions to create the references you need. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/hostwin/69955/HTML/default/viewer.htm#n0ejqm9d28y6vcn1o73dvsvzv27m.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/hostwin/69955/HTML/default/viewer.htm#n0ejqm9d28y6vcn1o73dvsvzv27m.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Dec 2016 23:33:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/read-a-dataset-within-a-dataset/m-p/320064#M70420</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-12-19T23:33:26Z</dc:date>
    </item>
    <item>
      <title>Re: read a dataset within a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/read-a-dataset-within-a-dataset/m-p/320065#M70421</link>
      <description>&lt;P&gt;From your description, it's not exactly clear which DD statement(s) you already have, and what your data set names are. &amp;nbsp;But there are other ways under MVS to locate a data set, other than coding a DD statement in the JCL. &amp;nbsp;You can have SAS define the libname within the SAS code. &amp;nbsp;Now you need to be able to include the location of the file. &amp;nbsp;If you don't know it, SAS won't know it either.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Dec 2016 23:35:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/read-a-dataset-within-a-dataset/m-p/320065#M70421</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-12-19T23:35:49Z</dc:date>
    </item>
    <item>
      <title>Re: read a dataset within a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/read-a-dataset-within-a-dataset/m-p/320068#M70423</link>
      <description>&lt;P&gt;cool.. here's my problem elaborated....&lt;/P&gt;&lt;P&gt;my input dataset : CHMICST.LISTCAT.OUTPUT9.NEW&lt;/P&gt;&lt;P&gt;in jcl u have to code as : //input1 dd dsn=CHMICST.LISTCAT.OUTPUT9.NEW,disp=shr&lt;/P&gt;&lt;P&gt;and within this CHMICST.LISTCAT.OUTPUT9.NEW dataset I have a record, only one single record. And the record is :&lt;/P&gt;&lt;P&gt;EDIB88T.NTRCS1T.D121616.T191033.M708600.CTLR&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SO you see the record is itself a dataset,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you tell me how to read EDIB88T.NTRCS1T.D121616.T191033.M708600.CTLR&amp;nbsp;&amp;nbsp;&amp;nbsp;?&lt;/P&gt;</description>
      <pubDate>Mon, 19 Dec 2016 23:56:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/read-a-dataset-within-a-dataset/m-p/320068#M70423</guid>
      <dc:creator>sayanapex06</dc:creator>
      <dc:date>2016-12-19T23:56:00Z</dc:date>
    </item>
    <item>
      <title>Re: read a dataset within a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/read-a-dataset-within-a-dataset/m-p/320070#M70424</link>
      <description>&lt;P&gt;You don't need a JCL dd statement to assign a libname. You can also assign a libname or filename via SAS syntax.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In your case:&lt;/P&gt;
&lt;P&gt;- Use a data _null_ step and create a macro variable using call symputx() which contains the value of the file you want to read.&lt;/P&gt;
&lt;P&gt;- Use the macro variable in a library assignment.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  set input1.new;
  call symputx('targetFile',&amp;lt;var from new ds&amp;gt;);
  stop;
run;

libname wantlib "&amp;amp;targetFile" disp=shr;

data want;
  set wantlib.&amp;lt;your ds&amp;gt;;
  ...
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2016 00:23:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/read-a-dataset-within-a-dataset/m-p/320070#M70424</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2016-12-20T00:23:11Z</dc:date>
    </item>
    <item>
      <title>Re: read a dataset within a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/read-a-dataset-within-a-dataset/m-p/320071#M70425</link>
      <description>&lt;P&gt;Thanks a lot !!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But could you please elaborate what is this &lt;SPAN class="token keyword"&gt;var&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;from&lt;/SPAN&gt; new ds ( the edi file...)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and also this line : wantlib&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;&amp;lt;&lt;/SPAN&gt;your ds&lt;SPAN class="token operator"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2016 00:15:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/read-a-dataset-within-a-dataset/m-p/320071#M70425</guid>
      <dc:creator>sayanapex06</dc:creator>
      <dc:date>2016-12-20T00:15:40Z</dc:date>
    </item>
    <item>
      <title>Re: read a dataset within a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/read-a-dataset-within-a-dataset/m-p/320072#M70426</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12447"&gt;@Patrick&lt;/a&gt;&amp;nbsp;the above&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2016 00:17:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/read-a-dataset-within-a-dataset/m-p/320072#M70426</guid>
      <dc:creator>sayanapex06</dc:creator>
      <dc:date>2016-12-20T00:17:35Z</dc:date>
    </item>
    <item>
      <title>Re: read a dataset within a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/read-a-dataset-within-a-dataset/m-p/320075#M70428</link>
      <description>&lt;P&gt;It's for me really long ago that I've used SAS under z/OS so no more that "fluent" in reading JCL.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A SAS library contains SAS tables. Under z/OS such a library is stored in a file and then the file is formatted internally by SAS. So you need to assign a libname statement for SAS to read the tables within this file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;//input1 dd dsn=CHMICST.LISTCAT.OUTPUT9.NEW,disp=shr&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You're allocating a file here. How do you read the record in it using SAS?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Does your target file contain text or SAS tables? If it's SAS tables then you need a libname statement to assign the library and then use a two level name &amp;lt;libref&amp;gt;.&amp;lt;table name&amp;gt; to get access to a specific table within this library. That's the &amp;lt;wantlib&amp;gt;.&amp;lt;your ds&amp;gt; syntax.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Are we dealing with a SAS library or is it just a flat file?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2016 00:24:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/read-a-dataset-within-a-dataset/m-p/320075#M70428</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2016-12-20T00:24:22Z</dc:date>
    </item>
    <item>
      <title>Re: read a dataset within a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/read-a-dataset-within-a-dataset/m-p/320076#M70429</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12447"&gt;@Patrick&lt;/a&gt;&amp;nbsp; it is a flat file&lt;/P&gt;&lt;P&gt;in z/OS&amp;nbsp;i.e ; by using jcl&lt;/P&gt;&lt;P&gt;we read a file assigned to a ddname like this :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data input;&lt;/P&gt;&lt;P&gt;infile input1;&lt;/P&gt;&lt;P&gt;input @1 .......... $x&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;.............................. ;&lt;/P&gt;&lt;P&gt;length @1 ............ $x ;&lt;/P&gt;&lt;P&gt;................................. ;&lt;/P&gt;&lt;P&gt;(.......) are for all the other fields/variables..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SO you got the idea right?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now my question comes here,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this input1 file which is our output9.new file has&amp;nbsp; a record ... and the record is itself a dataset.. How can you read that dataset when you are not able to assign it to a dd name ?? ( cause the record changes according to situation.. and so does the dataset(record) ) .. hope u finally got me&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2016 00:34:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/read-a-dataset-within-a-dataset/m-p/320076#M70429</guid>
      <dc:creator>sayanapex06</dc:creator>
      <dc:date>2016-12-20T00:34:57Z</dc:date>
    </item>
    <item>
      <title>Re: read a dataset within a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/read-a-dataset-within-a-dataset/m-p/320077#M70430</link>
      <description>&lt;P&gt;O.K: So you've got two flat files (and not SAS libraries)&lt;/P&gt;
&lt;P&gt;- flat file1 contains a single records which is the name of another flat file (flat file2)&lt;/P&gt;
&lt;P&gt;- flat file2 contains the data you want to read via a SAS datastep. The name of the file can change, the structure is always the same&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is above correct?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If yes then we need a Filename and not a Libname statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Code&amp;nbsp;along the line of below should do the job.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;//input1 dd dsn=CHMICST.LISTCAT.OUTPUT9.NEW,disp=shr

  /* read single record from input1 containing another filename */
  data _null_;
    infile input1 lrcl=200;
    input;
    call symputx('targetFile',_infile_);
    stop;
  run;

  /* now read data from flatfile with data */
  filename wantfile "&amp;amp;targetFile" disp=shr;
  data want;
    infile wantfile lcrel=... truncover dlm=... dsd ...;

    /* length and attrib statement for input variables to be defined before input statement */
    length @1 ............ $x ;

    input @1 .......... $x  ;
      .............................. ;
    ................................. ;
    (.......) are for all the other fields/variables..
  ;
  run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2016 00:58:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/read-a-dataset-within-a-dataset/m-p/320077#M70430</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2016-12-20T00:58:46Z</dc:date>
    </item>
    <item>
      <title>Re: read a dataset within a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/read-a-dataset-within-a-dataset/m-p/320081#M70432</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12447"&gt;@Patrick&lt;/a&gt;&amp;nbsp; awesome man!! Thanks a ton for this quick and easy solution..... learnt this...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One more thing... if the flat file 2 which is my record, which changes situation wise...&lt;/P&gt;&lt;P&gt;what if I have got two record lines i.e; two datsets to read.....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;can we loop it?? or the same would work ??&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2016 01:18:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/read-a-dataset-within-a-dataset/m-p/320081#M70432</guid>
      <dc:creator>sayanapex06</dc:creator>
      <dc:date>2016-12-20T01:18:27Z</dc:date>
    </item>
    <item>
      <title>Re: read a dataset within a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/read-a-dataset-within-a-dataset/m-p/320082#M70433</link>
      <description>&lt;P&gt;&lt;EM&gt;what if I have got two record lines i.e; two datsets to read.....&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;I wanted to keep the code simple for you but there is also a solution for multiple files.&amp;nbsp;Example 5 under the following link shows you how that's done.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lestmtsref/69738/HTML/default/viewer.htm#n1rill4udj0tfun1fvce3j401plo.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lestmtsref/69738/HTML/default/viewer.htm#n1rill4udj0tfun1fvce3j401plo.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For &amp;nbsp;your use case the code should be something close to below.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;//input1 dd dsn=CHMICST.LISTCAT.OUTPUT9.NEW,disp=shr

    data want;
     length fileloc myinfile $ 300;
     infile input1 truncover;
     input fileloc $ ; /* read instream data       */
    /* The INFILE statement closes the current file 
       and opens a new one if FILELOC changes value 
       when INFILE executes                        */
     infile dummy filevar=fileloc 
            filename=myinfile end=done
            lcrel=... truncover dlm=... dsd ...
            ; 
    /* DONE set to 1 when last input record read  */
     do while(not done);
    /* Read all input records from the currently  */
    /* opened input file, write to ALLSALES       */

      length @1 ............ $x ;

      input @1 .......... $x  ;
        .............................. ;
      ................................. ;
      (.......) are for all the other fields/variables..
       output;
     end;
     put 'Finished reading ' myinfile=; 
  run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;P.S: Don't use the term "dataset" for flat files as that's confusing for SAS guys like me. In a SAS context SAS tables are often referred to as datasets - that's why I thought in the beginning you're dealing with SAS libraries.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2016 01:51:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/read-a-dataset-within-a-dataset/m-p/320082#M70433</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2016-12-20T01:51:26Z</dc:date>
    </item>
    <item>
      <title>Re: read a dataset within a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/read-a-dataset-within-a-dataset/m-p/320091#M70439</link>
      <description>&lt;P&gt;Thanks &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12447"&gt;@Patrick&lt;/a&gt;&amp;nbsp; .. could you please explain...&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2016 04:30:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/read-a-dataset-within-a-dataset/m-p/320091#M70439</guid>
      <dc:creator>sayanapex06</dc:creator>
      <dc:date>2016-12-20T04:30:04Z</dc:date>
    </item>
    <item>
      <title>Re: read a dataset within a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/read-a-dataset-within-a-dataset/m-p/320157#M70464</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/120272"&gt;@sayanapex06&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;Not sure what you want me to explain. Have a look at the link I've posted and especially at example 5. There are explanations there in the docu of how things work and the code I've posted is very close to example 5.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2016 09:56:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/read-a-dataset-within-a-dataset/m-p/320157#M70464</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2016-12-20T09:56:36Z</dc:date>
    </item>
    <item>
      <title>Re: read a dataset within a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/read-a-dataset-within-a-dataset/m-p/320454#M70595</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12447"&gt;@Patrick&lt;/a&gt;&amp;nbsp;Its not working as expected.. I am getting errors.. Cant we place the previous example you gave and place it inside a loop?&lt;/P&gt;</description>
      <pubDate>Wed, 21 Dec 2016 09:46:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/read-a-dataset-within-a-dataset/m-p/320454#M70595</guid>
      <dc:creator>sayanapex06</dc:creator>
      <dc:date>2016-12-21T09:46:28Z</dc:date>
    </item>
    <item>
      <title>Re: read a dataset within a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/read-a-dataset-within-a-dataset/m-p/320458#M70597</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/120272"&gt;@sayanapex06&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12447"&gt;@Patrick&lt;/a&gt;&amp;nbsp;Its not working as expected.. I am getting errors.. Cant we place the previous example you gave and place it inside a loop?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I don't see any errors.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Dec 2016 10:23:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/read-a-dataset-within-a-dataset/m-p/320458#M70597</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-12-21T10:23:22Z</dc:date>
    </item>
    <item>
      <title>Re: read a dataset within a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/read-a-dataset-within-a-dataset/m-p/320539#M70625</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12447"&gt;@Patrick&lt;/a&gt;&amp;nbsp;in the solution I accepted for this post which is using a call function.... Cant we loop the data statement for each iteration until EOF?? Please help me with that code only&lt;/P&gt;</description>
      <pubDate>Wed, 21 Dec 2016 15:56:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/read-a-dataset-within-a-dataset/m-p/320539#M70625</guid>
      <dc:creator>sayanapex06</dc:creator>
      <dc:date>2016-12-21T15:56:27Z</dc:date>
    </item>
    <item>
      <title>Re: read a dataset within a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/read-a-dataset-within-a-dataset/m-p/320626#M70638</link>
      <description>&lt;P&gt;Do the files have the same data structure?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Assuming they do, you can use a method with the infile and FILEVAR option. The FILEVAR option allows you to specify the input file and the data set used for this contains the reference to the file to be read.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's an example of how this would be done from scratch, but you already have the file with the list of files to be read.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So using step 2 as a starting point in the example here.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.ats.ucla.edu/stat/sas/faq/multi_file_read.htm" target="_blank"&gt;http://www.ats.ucla.edu/stat/sas/faq/multi_file_read.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Dec 2016 21:13:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/read-a-dataset-within-a-dataset/m-p/320626#M70638</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-12-21T21:13:55Z</dc:date>
    </item>
    <item>
      <title>Re: read a dataset within a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/read-a-dataset-within-a-dataset/m-p/320643#M70644</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/120272"&gt;@sayanapex06&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;Please post the log with the error.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Using &lt;EM&gt;Infile ... Filevar=&lt;/EM&gt; is the most straightforward way for&amp;nbsp;reading multiple same structured input sources into an&amp;nbsp;output table.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Dec 2016 22:29:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/read-a-dataset-within-a-dataset/m-p/320643#M70644</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2016-12-21T22:29:03Z</dc:date>
    </item>
    <item>
      <title>Re: read a dataset within a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/read-a-dataset-within-a-dataset/m-p/320706#M70665</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12447"&gt;@Patrick&lt;/a&gt;&amp;nbsp;do while(not done) is not reading the input dummy file..&lt;/P&gt;&lt;P&gt;do until(not done) is reading wrong values from input dummy file&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;please give me a way to do this...&lt;/P&gt;</description>
      <pubDate>Thu, 22 Dec 2016 11:12:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/read-a-dataset-within-a-dataset/m-p/320706#M70665</guid>
      <dc:creator>sayanapex06</dc:creator>
      <dc:date>2016-12-22T11:12:41Z</dc:date>
    </item>
  </channel>
</rss>

