[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 - use Dynamic Substitution of variable
- Subject: Re: Q: record lenght as variable - use Dynamic Substitution of variable
- From: Manoj Gurjar <mgurjar@HOTMAIL.COM>
- Date: Fri, 22 Oct 1999 15:38:42 EDT
Nitin,
I would do like this (dynamic subtitution) :
! Say you get value of record length in Varible : #my_length
let $my_open_command = 'OPEN $output_file as 1 for-writing record = ' ||
#my_length || ' status = #filestat1 '
! and when you want to open a file with your variable record length
! type as
[$my_open_command]
Hope this Helps,
Manoj
>From: John Milardovic <milardj@SX.COM>
>Reply-To: SQR-USERS@list.iex.net
>To: Multiple recipients of list SQR-USERS <SQR-USERS@list.iex.net>
>Subject: Re: Q: record lenght as variable
>Date: Fri, 22 Oct 1999 11:05:59 -0400
>
>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
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com