[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



The third argument in the print position only specifies max width not min
width.  If you want all your output lines the same length one way to do it
is to use 'rpad' to make all the variables the same size.

Something along the lines of:
******
let #num_of_cols = 1000
let #length = length($output_buff)
let $new_output_buff = rpad($output_buff, #num_of_cols - #length, ' ' )
******
-------------------------
John Milardovic


> -----Original Message-----
> From: Bruce Weinstein [SMTP:bruceweinstein@CANADA.COM]
> Sent: Friday, June 04, 1999 2:54 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