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

Re: SQR continuing before call system using complete



Thank you Krishnan (and everyone else who responded with suggestions)

For some reason WAIT didn't work - I was running in a WIN-NT environment.
When implemented it will be running for the majority on the time on the UNIX
side.  It's my understanding from reading the SQR manual that WAIT will not
work there either.  Still don't understand why it didn't work in WIN-NT
however!

Actually I tried your suggestion (my coding wasn't as well written as yours
however!).  What happens though is that the file exists before all records
have been sorted and added to it!  It quit the loop and continued with the
SQR processing only about 215 of the 1000+ records.

I think I can do something similar however by having a call system command
create a dummy file and checking for the existence of that file instead.
This is not my original idea.  On the way home yesterday the light bulb went
on and I remembered I had read of this solution or something similiar to
this probably on this listserv.

Thank you again!

Have a great day,
Anne-Marie

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Anne-Marie Matula
Student Information System Project
Office of Information Technologies
Whitmore Bldg, University of Massachusetts, Amherst
Phone:  413/577-0685
Fax:    413/545-2150


> -----Original Message-----
> From: Krishnan Sarangarajan [mailto:ksaranga@ruan.com]
> Sent: Monday, February 14, 2000 6:17 PM
> To: 'sqr-users@list.iex.net'
> Cc: 'amatula@OIT.UMASS.EDU'
> Subject: RE: SQR continuing before call system using complete
>
>
> Anne-Marie - Instead of using SQR's wait command or something
> else, you can
> try the following approach :
>
> Let the SQR go into a so-called "infinite" loop. The condition for the SQR
> to break out of this loop would be the presence of the sorted file.
>
> Here is a sample code :
>
>  Let $command_String = 'cmd.exe /c sort /R /+'||TO_CHAR({SATLEN}+1)||' <
> c:\ps\temp\satkeyed.txt > c:\ps\temp\satsortd.txt'
>  CALL SYSTEM USING $command_String #status
>
>   let $sortf = 'c:\ps\temp\satsortd.txt'
>
>  while 1
>    let #ks = exists($sortf)
>
>    ! If the file exists, the return status will be a zero...
>    if (#ks = 0)
>      break
>    end-if
>  end-while
>
> At this point, yuo can execute the following step :
>
> "3.  Opens the sorted file for processing (write certain data from the
> sorted file to another file)"
>
> Reason for the problem : When calling a DOS command or a UNIX command from
> within a SQR, the external processes are assumed to run in the background
> thereby allowing the SQR to continue in the foreground.
>
> Due to this, the SQR doesn't hold for the previous process to complete.
>
> Hope this helps.
>
> Sincerely,
> Krishnan
>
> Ruan Transportation Management Systems
> (515) 245-5655 [P]
> (515) 247-2065 [F]
> ksaranga@ruan.com
>