Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Linesize limit question

Status
Not open for further replies.

rajTT

Programmer
Mar 2, 2003
10
US
Hello

I'm trying to read in a file and the linesize is 1872 characters wide. I tried setting the linesize in the options section (linesize=1872) and under infile (infile in lrecl=1872)

But when it prints the record its broken up into multiple sections instead of one nice long record set.

If anyone can help it would be appreciated.

Thanks in advance!

 
I have always thought that Linesize was only used for output files and was limited to 256... but everyone uses SAS differently.

Depending on the version of SAS there are some character size limitations too. At one point you could only read in 200 chars into any one var.

Any reason you have to read in the whole record into one variable and that you could not read in just the pieces that you want?

Here is a sample from when I worked in SAS 6 & 7.

ex:
DATA FILEA <=== SAS TEMP NAME
INFILE INPUT; <=== JCL FILE NAME OR INPUT FROM OTHER SOURCE
INPUT @1 VAR1 $CHAR9.
/* NINE CHARACTERS */
@10 VAR2 IB2.0
/* FIXED BINARY 15 */
@12 VAR3 ZD5.3
/*CHARACTER NUMERIC DATA - FIVE CHARS &
3 ARE TO THE RIGHT OF THE DECIMAL */
@17 VAR4 PD5.3
/* PACKED NUMERIC DATA - LIKE FIXED DEC
THIS EX IS SIX CHARACTERS ***NOT NUMS
AND THE LAST THREE ARE RIGHT OF DEC
POINT. PLI DECLARE IS FD(6,3) */
@830 VAR5 $CHAR200. @;
/* SAS LIMITATION TO 200 BYTES FOR
FOR A VARIABLE. NOTE THE PERIOD
AT THE END OF THE CHARACTER DEFINE
ALSO NOTE @; WHICH MEANS END OF
RECORD. THIS WILL PREVENT SAS
FROM GOING TO THE NEXT RECORD */
 
I'm sure if that answered my question thought it is something i will keep in mind.

When ever the record set is printed, the record set gets broken up into multiple lines. Now the record set is 1800 characters wide, is SAS limited to how many characters each line may hold, for example 256 when it prints?

Thanks again!
 
THe values of the LINESIZE = option are limited to the ranges from 64 to 256:


--------------------------------------------------------------------------------

Syntax
LINESIZE=n| nK | nM | nG | MIN | MAX | hex


Syntax Description

n | nK | nM | nG
specifies the number of buffers in multiples of 1, 1,000, 1,000,000, and 1, 000,000,000, respectively.

MIN
sets the line size of the SAS procedure output to 64.

MAX
sets the line size of the SAS procedure output to 256.

hex
specifies the line size of the SAS procedure output as a hexadecimal number. This number must be followed by an X.

I am not surer why you need to change linesize to a number greater than 256. If you need to have a file with 1872 characters wide, use data step to output a flat file with lrecl=1872 option in your file statement.

 
By having a linesize greater than 256 i hope to avoid having the record set broken up into multiple lines when i print. Any idea how i can do that? you suggested on a previous post that i should output to a flat file, but i have no idea of how i should do that.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top