<?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: Break Up Large File into Multiple Small Files in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Break-Up-Large-File-into-Multiple-Small-Files/m-p/59669#M12931</link>
    <description>Aside from a SAS-based solution, if you are licensed for DFSORT, there is a SPLIT function (part of OUTFIL coding, also, it uses the SPLITBY=nnn) to perform this function.  No hassles with DCB= coding - very effective and can run on any LPAR (if you have a SAS-licensed LPAR arrangement).&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
    <pubDate>Tue, 28 Jul 2009 20:41:23 GMT</pubDate>
    <dc:creator>sbb</dc:creator>
    <dc:date>2009-07-28T20:41:23Z</dc:date>
    <item>
      <title>Break Up Large File into Multiple Small Files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Break-Up-Large-File-into-Multiple-Small-Files/m-p/59668#M12930</link>
      <description>I have a large input file that I need to break up into smaller files of  250 records.  The size of the input file changes so the number of observations is never the same.  Can I alter my code below to create multiple out files of 250 records?&lt;BR /&gt;
&lt;BR /&gt;
Thanks&lt;BR /&gt;
&lt;BR /&gt;
//S02     EXEC SAS                                                      &lt;BR /&gt;
//WORK      DD SPACE=(CYL,(150,150))                                    &lt;BR /&gt;
//IN1       DD DSN=DC.XXXXX.ORS.CONV.WORK1(+1),                         &lt;BR /&gt;
//             DISP=SHR                                                 &lt;BR /&gt;
//*OUT DD SYSOUT=*                                                      &lt;BR /&gt;
//OUT       DD DSN=DC.XXXXX.ORS.CONV.WORK2(+1),                         &lt;BR /&gt;
//             DISP=(,CATLG,DELETE),                                    &lt;BR /&gt;
//             UNIT=SYSDA,                                              &lt;BR /&gt;
//             LRECL=80,                                                &lt;BR /&gt;
//             BLKSIZE=6160,                                            &lt;BR /&gt;
//             RECFM=FB,                                                &lt;BR /&gt;
//             SPACE=(TRK,(15,15),RLSE)                                 &lt;BR /&gt;
//SYSIN   DD *                                                          &lt;BR /&gt;
DATA RECORD;                                                            &lt;BR /&gt;
   INFILE IN1 FIRSTOBS=1 OBS=250;                                       &lt;BR /&gt;
   INPUT @39 VOLS $6.;                                                  &lt;BR /&gt;
   FILE OUT;                                                            &lt;BR /&gt;
   IDVAR+1;                                                             &lt;BR /&gt;
  PUT @1 '//DD'IDVAR  HEX2.' DD UNIT=3390,DISP=SHR,VOL=SER='VOLS +(-1) /&lt;BR /&gt;
      @3 'CONVERTV SMS REDET ALLMULTI DDN(DD'IDVAR HEX2. ')';</description>
      <pubDate>Tue, 28 Jul 2009 20:13:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Break-Up-Large-File-into-Multiple-Small-Files/m-p/59668#M12930</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-07-28T20:13:24Z</dc:date>
    </item>
    <item>
      <title>Re: Break Up Large File into Multiple Small Files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Break-Up-Large-File-into-Multiple-Small-Files/m-p/59669#M12931</link>
      <description>Aside from a SAS-based solution, if you are licensed for DFSORT, there is a SPLIT function (part of OUTFIL coding, also, it uses the SPLITBY=nnn) to perform this function.  No hassles with DCB= coding - very effective and can run on any LPAR (if you have a SAS-licensed LPAR arrangement).&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Tue, 28 Jul 2009 20:41:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Break-Up-Large-File-into-Multiple-Small-Files/m-p/59669#M12931</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-07-28T20:41:23Z</dc:date>
    </item>
    <item>
      <title>Re: Break Up Large File into Multiple Small Files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Break-Up-Large-File-into-Multiple-Small-Files/m-p/59670#M12932</link>
      <description>Thanks Scott&lt;BR /&gt;
I was playing a little with _n_ and thought that might be a solution but will look into yours.</description>
      <pubDate>Wed, 29 Jul 2009 14:43:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Break-Up-Large-File-into-Multiple-Small-Files/m-p/59670#M12932</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-07-29T14:43:49Z</dc:date>
    </item>
    <item>
      <title>Re: Break Up Large File into Multiple Small Files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Break-Up-Large-File-into-Multiple-Small-Files/m-p/59671#M12933</link>
      <description>Your post indicates that your input file (a plus 1 generation - maybe it's created earlier in the same job?) -- but you are attempting to generate DD statements from your SAS program *AND* in the same job/step (SAS DATA step) you are showing an INFILE / FILE combination to filter in some increments (one input file to "n" output files).&lt;BR /&gt;
&lt;BR /&gt;
Suggest you review your SAS program processing in detail, as you have the "cart" before the "horse" -- you will need to investigate using FILENAME to dynamically allocate your output file from within your SAS program -- or if you must generate the JCL, you will need to have two jobs, one to generate the JCL (and that job will get submitted for execution), and the second "generated" jobstream will perform the data split.&lt;BR /&gt;
&lt;BR /&gt;
However, given this thread, I still recommend you consider DFSORT (or a suitable alternative with your site's SORT package).&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Wed, 29 Jul 2009 16:38:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Break-Up-Large-File-into-Multiple-Small-Files/m-p/59671#M12933</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-07-29T16:38:18Z</dc:date>
    </item>
    <item>
      <title>Re: Break Up Large File into Multiple Small Files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Break-Up-Large-File-into-Multiple-Small-Files/m-p/59672#M12934</link>
      <description>Sorry - I also wanted to mention that you can avoid the DCB attributes altogether with SAS by using the JFCB=&lt;YOUR_INPUT_DDNAME&gt;  parameter on the FILE statement in your DATA step.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;/YOUR_INPUT_DDNAME&gt;</description>
      <pubDate>Wed, 29 Jul 2009 16:39:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Break-Up-Large-File-into-Multiple-Small-Files/m-p/59672#M12934</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-07-29T16:39:59Z</dc:date>
    </item>
    <item>
      <title>Re: Break Up Large File into Multiple Small Files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Break-Up-Large-File-into-Multiple-Small-Files/m-p/59673#M12935</link>
      <description>%LET OBS=1009 ;&lt;BR /&gt;
 %MACRO TEST;&lt;BR /&gt;
      %LET I=1;&lt;BR /&gt;
 %DO %UNTIL(%EVAL(&amp;amp;POBS &amp;lt;= 0));&lt;BR /&gt;
       %LET ENDP= %EVAL(&amp;amp;I * 250) ;&lt;BR /&gt;
    %LET STARTP =%EVAL(&amp;amp;ENDP - 250 + 1);&lt;BR /&gt;
   %LET POBS =%EVAL(&amp;amp;OBS - &amp;amp;ENDP) ;&lt;BR /&gt;
      %IF %EVAL(&amp;amp;POBS &amp;lt;= 0) %THEN %DO;&lt;BR /&gt;
          %LET ENDP=&amp;amp;OBS ;&lt;BR /&gt;
           %LET POBS =0;&lt;BR /&gt;
  %END;&lt;BR /&gt;
      %LET FILE=FILE&amp;amp;I ;&lt;BR /&gt;
	  	  %LET REC=%EVAL(&amp;amp;ENDP - &amp;amp;STARTP +1);&lt;BR /&gt;
          %LET I = %EVAL(&amp;amp;I  + 1) ;&lt;BR /&gt;
&lt;BR /&gt;
 %PUT  FILE_NO= &amp;amp;FILE RECORD=&amp;amp;REC START= &amp;amp;STARTP END= &amp;amp;ENDP REMAINDER= &amp;amp;POBS ;&lt;BR /&gt;
  %END;&lt;BR /&gt;
  %MEND;&lt;BR /&gt;
  %TEST;&lt;BR /&gt;
&lt;BR /&gt;
Just change the value of %LET OBS=1009 for different size file.&lt;BR /&gt;
&lt;BR /&gt;
Hope this help.</description>
      <pubDate>Fri, 11 Sep 2009 16:51:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Break-Up-Large-File-into-Multiple-Small-Files/m-p/59673#M12935</guid>
      <dc:creator>Kwok</dc:creator>
      <dc:date>2009-09-11T16:51:25Z</dc:date>
    </item>
    <item>
      <title>Re: Break Up Large File into Multiple Small Files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Break-Up-Large-File-into-Multiple-Small-Files/m-p/59674#M12936</link>
      <description>Sorry, for some reason the last post was truncated. Do you know how to increase the size of the page ?</description>
      <pubDate>Fri, 11 Sep 2009 16:57:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Break-Up-Large-File-into-Multiple-Small-Files/m-p/59674#M12936</guid>
      <dc:creator>Kwok</dc:creator>
      <dc:date>2009-09-11T16:57:20Z</dc:date>
    </item>
    <item>
      <title>Re: Break Up Large File into Multiple Small Files</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Break-Up-Large-File-into-Multiple-Small-Files/m-p/59675#M12937</link>
      <description>This continuing problem exists with the software used to host the SAS Discussion Forums.  You will need to find some alternate technique to post some code, possibly leaving out or masking "special" characters, unfortunately.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Fri, 11 Sep 2009 17:12:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Break-Up-Large-File-into-Multiple-Small-Files/m-p/59675#M12937</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-09-11T17:12:15Z</dc:date>
    </item>
  </channel>
</rss>

