<?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 Limitation in line size while writing to file (catalog)? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Limitation-in-line-size-while-writing-to-file-catalog/m-p/38240#M7654</link>
    <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
I´m trying to write a variable about 1000 chars long to a file, but i don´t seem to get more than the first 384 characters written to the file. I´m farely new to SAS - i´ve tried reading the documentation but i can´t seem to find the solution. If anyone knows what i´m doing wrong or if this actually is a limitation, please help me. .&lt;BR /&gt;
&lt;BR /&gt;
As an example, the following snippet is only displaying 384 of the expected 400 chars.&lt;BR /&gt;
&lt;BR /&gt;
Kind regards,&lt;BR /&gt;
&lt;BR /&gt;
filename thefile catalog 'work.SCMR.testing.source' lrecl=32767;&lt;BR /&gt;
data _null_;&lt;BR /&gt;
	  file thefile lrecl=32767 LINESIZE=10000;&lt;BR /&gt;
	  length test $ 32767;&lt;BR /&gt;
      test = '****************************************************************************************************' !!&lt;BR /&gt;
             '1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111' !!&lt;BR /&gt;
             '2222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222' !!&lt;BR /&gt;
             '****************************************************************************************************';&lt;BR /&gt;
	  put test;&lt;BR /&gt;
run;</description>
    <pubDate>Mon, 21 Jun 2010 10:24:55 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2010-06-21T10:24:55Z</dc:date>
    <item>
      <title>Limitation in line size while writing to file (catalog)?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Limitation-in-line-size-while-writing-to-file-catalog/m-p/38240#M7654</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
I´m trying to write a variable about 1000 chars long to a file, but i don´t seem to get more than the first 384 characters written to the file. I´m farely new to SAS - i´ve tried reading the documentation but i can´t seem to find the solution. If anyone knows what i´m doing wrong or if this actually is a limitation, please help me. .&lt;BR /&gt;
&lt;BR /&gt;
As an example, the following snippet is only displaying 384 of the expected 400 chars.&lt;BR /&gt;
&lt;BR /&gt;
Kind regards,&lt;BR /&gt;
&lt;BR /&gt;
filename thefile catalog 'work.SCMR.testing.source' lrecl=32767;&lt;BR /&gt;
data _null_;&lt;BR /&gt;
	  file thefile lrecl=32767 LINESIZE=10000;&lt;BR /&gt;
	  length test $ 32767;&lt;BR /&gt;
      test = '****************************************************************************************************' !!&lt;BR /&gt;
             '1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111' !!&lt;BR /&gt;
             '2222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222' !!&lt;BR /&gt;
             '****************************************************************************************************';&lt;BR /&gt;
	  put test;&lt;BR /&gt;
run;</description>
      <pubDate>Mon, 21 Jun 2010 10:24:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Limitation-in-line-size-while-writing-to-file-catalog/m-p/38240#M7654</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-06-21T10:24:55Z</dc:date>
    </item>
    <item>
      <title>Re: Limitation in line size while writing to file (catalog)?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Limitation-in-line-size-while-writing-to-file-catalog/m-p/38241#M7655</link>
      <description>From my test of your code it is working fine.  I even made TEST longer and the notes show that all bytes in TEST are written. &lt;BR /&gt;
&lt;BR /&gt;
When you write &lt;BR /&gt;
&amp;gt; As an example, the following snippet is only&lt;BR /&gt;
&amp;gt; displaying 384 of the expected 400 chars.&lt;BR /&gt;
how do you determine that only 384 chars are DISPLAYING?&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
121  filename thefile catalog 'work.SCMR.testing.source' lrecl=32767;&lt;BR /&gt;
122  data _null_;&lt;BR /&gt;
123  file thefile lrecl=32767 LINESIZE=10000;&lt;BR /&gt;
124  length test $ 32767;&lt;BR /&gt;
125  test =&lt;BR /&gt;
125! '*******************************************************************************************&lt;BR /&gt;
125! *********' !!&lt;BR /&gt;
126  '1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111&lt;BR /&gt;
126! 111111111' !!&lt;BR /&gt;
127  '2222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222&lt;BR /&gt;
127! 222222222' !!&lt;BR /&gt;
128  '*******************************************************************************************&lt;BR /&gt;
128! *********';&lt;BR /&gt;
129  test = cats(test,test,test,test,test,test);&lt;BR /&gt;
130  put test;&lt;BR /&gt;
131  run;&lt;BR /&gt;
&lt;BR /&gt;
NOTE: The file THEFILE is:&lt;BR /&gt;
      (system-specific pathname),&lt;BR /&gt;
      (system-specific file attributes)&lt;BR /&gt;
&lt;BR /&gt;
NOTE: 1 record was written to the file (system-specific pathname).&lt;BR /&gt;
      The minimum record length was 2400.&lt;BR /&gt;
      The maximum record length was 2400.&lt;BR /&gt;
NOTE: DATA statement used (Total process time):&lt;BR /&gt;
      real time           0.00 seconds&lt;BR /&gt;
      cpu time            0.00 seconds&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
132&lt;BR /&gt;
133  data _null_;&lt;BR /&gt;
134     infile thefile lrecl=32767 LINESIZE=10000;&lt;BR /&gt;
135     input;&lt;BR /&gt;
136     list;&lt;BR /&gt;
137     run;&lt;BR /&gt;
&lt;BR /&gt;
NOTE: The infile THEFILE is:&lt;BR /&gt;
      (system-specific pathname),&lt;BR /&gt;
      (system-specific file attributes)&lt;BR /&gt;
&lt;BR /&gt;
RULE:     ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+--&lt;BR /&gt;
1         ***************************************************************************************&lt;BR /&gt;
      88  *************11111111111111111111111111111111111111111111111111111111111111111111111111&lt;BR /&gt;
     175  111111111111111111111111112222222222222222222222222222222222222222222222222222222222222&lt;BR /&gt;
     262  222222222222222222222222222222222222222************************************************&lt;BR /&gt;
     349  ***************************************************************************************&lt;BR /&gt;
     436  *****************************************************************1111111111111111111111&lt;BR /&gt;
     523  111111111111111111111111111111111111111111111111111111111111111111111111111111222222222&lt;BR /&gt;
RULE:     ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+--&lt;BR /&gt;
     610  222222222222222222222222222222222222222222222222222222222222222222222222222222222222222&lt;BR /&gt;
     697  2222***********************************************************************************&lt;BR /&gt;
     784  ***************************************************************************************&lt;BR /&gt;
     871  ******************************111111111111111111111111111111111111111111111111111111111&lt;BR /&gt;
     958  111111111111111111111111111111111111111111122222222222222222222222222222222222222222222&lt;BR /&gt;
    1045  22222222222222222222222222222222222222222222222222222222*******************************&lt;BR /&gt;
    1132  ***************************************************************************************&lt;BR /&gt;
    1219  **********************************************************************************11111&lt;BR /&gt;
    1306  111111111111111111111111111111111111111111111111111111111111111111111111111111111111111&lt;BR /&gt;
    1393  111111112222222222222222222222222222222222222222222222222222222222222222222222222222222&lt;BR /&gt;
    1480  222222222222222222222******************************************************************&lt;BR /&gt;
    1567  ***************************************************************************************&lt;BR /&gt;
    1654  ***********************************************1111111111111111111111111111111111111111&lt;BR /&gt;
    1741  111111111111111111111111111111111111111111111111111111111111222222222222222222222222222&lt;BR /&gt;
    1828  2222222222222222222222222222222222222222222222222222222222222222222222222**************&lt;BR /&gt;
    1915  ***************************************************************************************&lt;BR /&gt;
    2002  ***************************************************************************************&lt;BR /&gt;
    2089  ************111111111111111111111111111111111111111111111111111111111111111111111111111&lt;BR /&gt;
    2176  111111111111111111111111122222222222222222222222222222222222222222222222222222222222222&lt;BR /&gt;
    2263  22222222222222222222222222222222222222*************************************************&lt;BR /&gt;
    2350  *************************************************** 2400&lt;BR /&gt;
NOTE: 1 record was read from the infile (system-specific pathname).&lt;BR /&gt;
      The minimum record length was 2400.&lt;BR /&gt;
      The maximum record length was 2400.&lt;BR /&gt;
NOTE: DATA statement used (Total process time):&lt;BR /&gt;
      real time           0.00 seconds&lt;BR /&gt;
      cpu time            0.01 seconds&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
[/pre]</description>
      <pubDate>Mon, 21 Jun 2010 12:18:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Limitation-in-line-size-while-writing-to-file-catalog/m-p/38241#M7655</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2010-06-21T12:18:56Z</dc:date>
    </item>
    <item>
      <title>Re: Limitation in line size while writing to file (catalog)?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Limitation-in-line-size-while-writing-to-file-catalog/m-p/38242#M7656</link>
      <description>Hi:&lt;BR /&gt;
  Are you writing to an existing partitioned data set (catalog) on the mainframe??? In some instances, for some types of PDS, you might be bound the the LRECL that was defined when the PDS was created. The example from DATA _NULL_ shows that you can write quite a large file. My suggestion would be to try to write to a single, non-catalog, non-PDS file and see whether you run into the same issue.  Otherwise, your best resource for this question might be to work with Tech Support. To open a track with Tech Support, go to:&lt;BR /&gt;
&lt;A href="http://support.sas.com/ctx/supportform/createForm" target="_blank"&gt;http://support.sas.com/ctx/supportform/createForm&lt;/A&gt;&lt;BR /&gt;
 &lt;BR /&gt;
cynthia&lt;BR /&gt;
&lt;BR /&gt;
PS...the SAS LINESIZE (such as for the output window has a limit of 256, but that is not the same as the limit for the LINESIZE option on the FILE statement. &lt;BR /&gt;
From the doc:&lt;BR /&gt;
&lt;B&gt;&lt;BR /&gt;
Default: The default LINESIZE= value is determined by one of two options: &lt;BR /&gt;
the LINESIZE= system option when you write to a file that contains carriage-control characters or to the SAS log.&lt;BR /&gt;
              &lt;BR /&gt;
the LRECL= option in the FILE statement when you write to a file.&lt;BR /&gt;
      &lt;BR /&gt;
Range: From 64 to the maximum logical record length that is allowed in your operating environment. &lt;BR /&gt;
Operating Environment Information:   The highest value allowed for LINESIZE= is dependent on your operating environment. For details, see the SAS documentation for your operating environment.  &lt;/B&gt;)</description>
      <pubDate>Mon, 21 Jun 2010 14:10:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Limitation-in-line-size-while-writing-to-file-catalog/m-p/38242#M7656</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2010-06-21T14:10:51Z</dc:date>
    </item>
    <item>
      <title>Re: Limitation in line size while writing to file (catalog)?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Limitation-in-line-size-while-writing-to-file-catalog/m-p/38243#M7657</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
Thanks for the answer, it got me wondering about what actually is displayed vs. the real content of the file and: the file contains the correct data but sas base (SAS 9.1.3 SP 4) only displays the first 384 chars. When opening the sas base file in ultraedit i can see that everything is correct. Should have thought of that possibility myself before posting, but thanks again!&lt;BR /&gt;
&lt;BR /&gt;
/Peder

And yes, when writing to a file instead the output looks ok. Thanks for the quick response.&lt;BR /&gt;
&lt;BR /&gt;
    &lt;BR /&gt;
Message was edited by: pfrohm</description>
      <pubDate>Mon, 21 Jun 2010 14:49:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Limitation-in-line-size-while-writing-to-file-catalog/m-p/38243#M7657</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-06-21T14:49:52Z</dc:date>
    </item>
  </channel>
</rss>

