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

Re: Writing Flat Files with SQR



You do not appear to be checking the open status here.  Chances are your
open statement is failing but you aren't seeing it.  Add the following code
after the OPEN:

    if #openstat <> 0
        display "Open of output file failed"
        stop
    end-if

This is a little unsophisticated of an error trap obviously, but you get
the basic idea.

If you are using PeopleSoft, you should set the Process scheduler flags and
put your message in the Process Scheduler status window, then use STOP QUIET.


At 09:35 AM 8/24/99 -0700, you wrote:
>This is a follow-up to my earlier post about viewing LIS files with Excel --
>Thanks to all who helped me out!
>
>I am getting the error message:
>
>'Specified file number not opened for writing.' when I run my SQR with the
>logic in it to create a TXT file with delimiters.  I have the following
>logic in the SQR:
>
>   #DEFINE Del         ';'            ! After the #include statements
>
>   LET $GMExecFile='ZFS04014.txt'     !In Begin-Report
>   OPEN $GMExecFile as 1 For-Writing Record=500 Status=#OpenStat   !In
>Begin-Report
>
>   DO Write-Output-Record             !In Begin-Report
>   DO Close-File                      !In Begin-Report
>
>begin-procedure Write-Output-Record
>Write 1 From                          !This line brings the error
>
>  $tl_cust_name        {Del}
>  $tl_cust_id          {Del}
>  $tl_product          {Del}
>  $tl_project_id       {Del}
>  $descr               {Del}
>  $spn_sales_person
>
>end-procedure !Write-Output-File
>
>I have gone over the chapter in SQR in PeopleSoft dealing with this, and I
>have studied all the responses I got from my earlier post. I can't see what
>is missing or wrong here.
>
>Help!?!
>
>TIA Much!
>
>Joe Johnson
>jejohn1216@surfree.com
>