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

Re: Update: Move command not moving in SQR



Thanks, Bill.  I will try this.

Steven Ross
Applications Developer/Analyst
sross@kcm.org
 


-----Original Message-----
From: Bill Winkfield [mailto:bwinkfield@GIA.EDU]
Sent: Wednesday, July 10, 2002 12:20 PM
To: SQR-USERS@list.iex.net
Subject: Re: Update: Move command not moving in SQR


Hi Steven,

Here is a snippet of code that has been working for us for some time now.

!**********************************************************************
!*                      Archive Source File
*
!**********************************************************************
Begin-Procedure Archive-Source-File
 let $comspec = getenv('comspec')
 let $cmdpath = $comspec || ' @start /min /wait cmd /c move '
 let $command = $cmdpath

 #debuga Show 'Archive path in Archive-Source-File: ' $Path
 !//
 !      Source for move command.
 !-----------------------------------------------!
 let $command = $command || $SourceData || $DefaultBlank || $Path

 #debuga Show $command
 call system using $command #rtrn_status

 If #rtrn_status <> 0
  !//
  !     PC/Windows: A value less than 32
  !     indicates an error.
  !-----------------------------------------------!
  #debuga Show 'The command failed -- manual intervention required.'
  #debuga Show #rtrn_status
  let $log_msg = 'Archiving of ' || $SourceData
                                           || ' cannot be completed.'
                                 || $CrLf
                                           || 'Error status of '
                                 || to_char(#rtrn_status)
                                 || ' received.'

  write {LOG_FILE} from $log_msg
Else
  let $log_msg = 'Data archived sucessfully to ' || $Path || '.'
  write {LOG_FILE} from $log_msg
End-If

End-Procedure Archive-Source-File
!**********************************************************************
!*                      End of procedure.
*
!**********************************************************************

Hope this helps,

Bill

-----Original Message-----
From: Ross, Steven [mailto:sross@KCM.ORG]
Sent: Wednesday, July 10, 2002 9:48 AM
To: SQR-USERS@list.iex.net
Subject: Update: Move command not moving in SQR

I didn't notice any replies to this message, and I still have the problem.
I've now tested it both on the client, and on the server (running this in
PeopleSoft 7.5), and the problem is identical.

Help! Please!

Steven

Original message:
-----------------
I have written a 'move' function in SQR that invokes the system move command
(Win2K) on a 'source' file(s) and 'target' directory.  This works when I run
it from a command line, however, when I run it from and SQR, it moves one
file in the directory, then errs out.  The return code that I'm getting is
"1" -- "incorrect function".

Here's a snippet of code:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    !* Check for Windows Version
    !*
    if rtrim($_kc_WinVer,' ') = ''
        do kc-GetWindowsVersion
    end-if

    !* Make sure the source directory ends with a slash...
    !*
    if substr($Source_Directory,length($Source_Directory),1) <> '\'
        let $kc_tmp_s = '\'
    else
        let $kc_tmp_s = ''
    end-if

    !* Load command line
    !*
    let $kc_src_dir = $Source_Directory || $kc_tmp_s

    !* Determine command line by Windows Version...
    !*
    Evaluate $_kc_WinVer
        when = 'WinXP'
        when = 'Win2K'
            let $kc_cmd = getenv('COMSPEC') ||' /c move /y ' || $kc_src_dir
|| $Files_To_Move || ' ' || $Target_Directory
            break
        when-other  !* NT or other...
            let $kc_cmd = getenv('COMSPEC') ||' /c move ' || $kc_src_dir ||
$Files_To_Move || ' ' || $Target_Directory
            break
    end-evaluate

    !* Make the system call to back up the files
    !*
    CALL SYSTEM USING $kc_cmd #ReturnValue WAIT

    !* On Windows systems, a non zero value indicates a failure.
    !*
    let $tmp_ReturnValue = '(' || ltrim(edit(#ReturnValue,'999'),' ') || ')'
    if #ReturnValue <> 0
        display '  Move: Failed' noline
        display $tmp_ReturnValue
    else
        display '  Move: Succeeded' noline
        display $tmp_ReturnValue
    end-if

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Okay, I know this is more than a snippet...

Any help would be greatly appreciated.

TIA,

Steven Ross
Applications Developer/Analyst
sross@kcm.org