[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
Re: Flat file creation problem
You can use rpad or lpad statements to format the field to a fixed
length. Or you can use rtrim or ltrim functions to cutshort to a fixed
length.
If you writing that to a .lis file using only the Select statements, you
can use the SQL rpad,lpad or ltrim, rtrim functions to achieve this
>----------
>From: Bruce Weinstein[SMTP:bruceweinstein@CANADA.COM]
>Reply To: SQR-USERS@list.iex.net
>Sent: Friday, June 04, 1999 2:53 PM
>To: Multiple recipients of list SQR-USERS
>Subject: Flat file creation problem
>
>Does anyone know how to insure that records created in a .lis file
>from an SQR is of a certain length? Because the last field being
>written out to the .lis file is a description, the record lengths in
>the .lis file vary depending on the length of the description.
>I can insure the record lengths by "opening" a file in the SQR and
>"writing" to this file, but I need it to work via the .lis route using
>the print command. The command I'm using is as follows
>
>"print $output_buff (1,1,1043)"
>
>If $output_buff is 10 characters then the record length is 10
>If $output_buff is 500 characters then the record length is 500
>
>----------------------------------------
>Bruce Weinstein
>E-mail: bruceweinstein@canada.com
>