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

Re: Multiple Output Records With Variable Filenames



Hi,
 Its prety simple actually.. Replace all the lets into one line. Like this:

     let $cmd1 = 'cp x.lis ' || &clock_no || '.lis'

    Raja



____________________Reply Separator____________________
Subject:    Multiple Output Records With Variable Filenames
Author: <SQR-USERS@USA.NET>
Date:       4/8/97 2:55 PM

We are using SQR in Unix. The following is a sample of the report I am
creating.  I am taking a clock_no record from the database and creating a file
that has a filename the same as the clock_no.  Therefore, for each clock_no
record I am getting a file named after the clock_no.   This report is working
but I am curious to see if there is a way to avoid so many lets, etc.  We are
new to SQR so I would like to know the possibilities.

Thanks in advance!

begin-setup
  page-size  55 80
end-setup

Begin-Program
 Do Main
End-program

Begin-Procedure Main
Begin-Select
x.clock_no  &clock_no (1,5)
 Do Detail
 let $cmd1 = 'cp x.lis '
 let $cmd2 = &clock_no
 let $cmd3 = '.lis'
 let $cmd = $cmd1||$cmd2||$cmd3
 new-report 'x.lis'
 call system using $cmd  #status
>From x
order by x.clock_no
End-Select
End-Procedure

Begin-Procedure Detail
Begin-Select
x2.f_name  (1,20)
x2.l_name  (1,40)
from x2
where x2.clock_no = &clock_no
End-Select
End-Procedure

Begin-Heading 4
 Date-Time (1,1) 'MM/DD/YY HH24:MI'
 Page-Number (1,75)
End-Heading