[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: Q: record lenght as variable



Hi Nitin.
        I would do as the others suggested except make your defined value as
large as possible (once it is compiled you won't be able to use ask or
modify the define).  If you need to end up with a fixed file then compare
the length of the record you are about to write to the passed parameter
record length and pad with blanks as appropriate or call a perl or awk or
shell script to pad each line to the appropriate length.

HTH
John Milardovic

> -----Original Message-----
> From: Sam Spritzer [SMTP:SSpritzer@GW.CTG.COM]
> Sent: Friday, October 22, 1999 8:10 AM
> To:   Multiple recipients of list SQR-USERS
> Subject:      Re: Q: record lenght as variable
>
> In your setup section, you define the size of the record
>
> #define rec_size1       1000
>
>
> And then, what you define will get passed as a parameter.
>
> OPEN $output_file as 1 for-writing record = {Rec_Size1}
>         status = #filestat1
> IF #filestat1 != 0
>   SHOW 'Error Opening File: ' $output_file
> END-IF
>
> Hope this helps,
> Sam
>
> <<< nitin rathor <tintin_n@HOTMAIL.COM> 10/22 12:13a >>>
> Hello EveryBody ,
>
> I want to pass record lenght of the file as the parameter and to use it in
> the "open" statement for file .
> I tried using both # and $ variables but got the error opening the file .
>
> Is it possible , first  of all to give variable as record length?
> IF yes then how ?
>
> I am using SQR 3 .
>
> Thanks ,
> Nitin.
>
> ______________________________________________________
> Get Your Private, Free Email at http://www.hotmail.com