[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
Re: Open and close .lis file
- Subject: Re: Open and close .lis file
- From: "Manning, Shinta" <shintamanning@NFISG.COM>
- Date: Tue, 17 Aug 1999 16:46:42 -0500
Thank you so much... you just save me from grief and frustration =)
> -----Original Message-----
> From: John Milardovic [SMTP:milardj@SX.COM]
> Sent: Tuesday, August 17, 1999 2:12 PM
> To: Multiple recipients of list SQR-USERS
> Subject: Re: Open and close .lis file
>
> Hi.
> Just use the new-report command. That allows you to specify the
> name of the .lis file. Just tack a variable to the name to make it unique
> and you will end up will 40 different files.
>
> Your program would look like this:
>
> let #x=0
> while #x < number of reports
> let $outfile= 'my_report_' || to_char(#x) || '.lis'
>
> !You might want to list the recipient in the filename to
> !assist in routing
>
> new-report $outfile
>
> do proc_to_get_details_and_print
>
> end-while
>
> This will give you 40 (or whatever) files with the naming convention of:
>
> my_report_0.lis
> my_report_1.lis
> etc.
>
> You would probably replace the while loop with a select statement to get
> the
> distribution and recipient details and then for each row retrieved call
> new-report and the procedure to actually get report details and print
> them.
>
> HTH
> John Milardovic
>
> PS: If your preparing a processing intensive report you might want to
> write
> some routines to figure out how many unique reports you need and how many
> copies of each unique report you need. Once you create the unique reports
> replicate them at the shell level until you get your total number needed.
> I
> had to do that last week and it's actually pretty simple.
>
> > -----Original Message-----
> > From: Manning, Shinta [SMTP:shintamanning@NFISG.COM]
> > Sent: Tuesday, August 17, 1999 2:56 PM
> > To: Multiple recipients of list SQR-USERS
> > Subject: Open and close .lis file
> >
> > I am trying to produce reports out of one program that will print to
> > different .lis files. For example, let's say there are 40 departments
> who
> > wants to get this report every week. All 40 may have variable selection
> > criteria. For example, department 1 wants all customers, department 2
> > wants
> > customers with balance > $500, etc. So my pseudo program would look
> like
> > this:
> >
> > DO getOccurrrence
> > while not done processing all occurrence
> > DO openLISFile
> > DO printReport !where this will have the BEGIN-SELECT
> > statement
> > DO closeLISFile
> > DO getOccurrence
> > end-while
> >
> >
> > As I understand it, SQR 'opens' .lis file at run time, and 'closes' .lis
> > file when the program ends. Is there anyway that I can open and close
> > .lis
> > file 'manually'? Could it be an option at the command line?
> >
> > Another way that I thought might work if opening and closing of LIS file
> > is
> > not possible, is to print report for the current occurrence to the .lis
> > file
> > like I normally would, then copy the existing content to another file
> for
> > that occurrence, CLEAR the LIS file so I'll have a clean LIS file for
> the
> > next occurrence. My pseudo program would look like the following:
> >
> > DO getOccurrence
> > while not done processing all occurrence
> > DO printReport
> > DO copyLISToNewFile
> > DO clearLISFile
> > DO getOccurrence
> > end-while
> >
> > But I haven't found an SQR utility that will CLEAR the LIS file. Can
> > someone tell me if there is a utility that will do that?
> >
> >
> > Thanks so much =)