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

Re: [sqr-users] Transferring output file within environments usingSQR when the SQR Report is run on NT



Hi Raghav,
   This might be fairly simple if you can create a share for the TST
box and create a mapping on the machine where the SQR is running.

   e.g 
   map Z: = \\TSTSERVER\sharedrive. 

Once you have this you can simply execute a copy command using the
system call to copy the file that might be the quickest of all options.

 
    let $cmd = 'copy \\DEVSERVER\filename Z:\filename' 

    call system using $cmd status=#stat 

    ! check the return status. 


  if not you may have to do an ftp. like in the script below, make sure
there is an ftp program available on the NT box and try to manually ftp
to the TST box from DEV and then you can use the script below with
changes to hostname userid and password. etc 

HTH 
Datta. 
--- Raghvendra Dharwada <dharwada@gmail.com> wrote:
> Hi all,
> Can anyone help me how to write a script in an SQR program that can
> transfer (copy) a file from one environment to another (say DEV to
> TST) (network folders) in Windows NT ?
> 
> The scenario is like this:
> 
> The SQR is run on NT.
> It creates an output file in DEV (in some folder)
> This file should be transferred to TST (in some folder)
> 
> Here are the software versions I am using
> $sqr-ver: SQR for PeopleSoft/8.44.08     /Sun/SunOS 5.6/Oracle
> 8.0.6/Mar 26 2004
> PeopleSoft: 8.8
> Oracle: 9i
> 
> I came across a script that transfers file from UNIX to NT i.e After
> the SQR runs on UNIX
> it transfers to NT.
> The code that I came across is as follows:
> I write the script in a file, execute it using the move-files
> procedure
> 
> begin-procedure write-sh-file
>         let $file-path = 'cd /home/out/payroll'  
>         let $L1 = 'HOST=' || '''x.x.x.x'''
>         let $L2 = 'USER=' || '''usename'''
>         let $L3 = 'PASSWD=' || '''pwd'''
>         let $L4 = 'echo ' || '"remote Login attempted"'
>         let $L5 = 'ftp -n $HOST <<END_SCRIPT'
>         let $L6 = 'quote USER  $USER'
>         let $L7 = 'quote PASS $PASSWD'
>         let $L8 = 'cd /GL/Reports'
>         let $L9 = 'prompt'
>         let $L10 = 'put ' || $filename1
>         let $L11 = 'END_SCRIPT'
>         let $L12 = 'FTP_RETURN_CODE=$?'
>         let $L13 = 'if [ $FTP_RETURN_CODE = 0 ]; then'
>         let $L14 = 'echo ' || '"Transfered Successful, deleting
> source files"'
>         let $L15 = 'cd /home/out/payroll'
>         let $L16 = 'delete ' || $filename1 
>         let $L17 = 'exit 0'
>         let $L18 = 'else'
>         let $L19 = 'echo' || '"Transfered failed"'
>         let $L20 = 'exit 1'
>         let $L21 = 'fi'
>         
>        
>         write 2 from $file-path
>         write 2 from  $L1        
>         -----
>        -----
> 
> End-procedure
> 
> In the above procedure :
> $filename1 = $Dept_Id || '_' || 'xxgl21_' || $prcs_process_instance
> || '.csv'
> 
>
!-----------------------------------------------------------------------
> !Procedure   : move-files
> !Called By   : wrap-up
>
!-----------------------------------------------------------------------
> begin-procedure move-files
>         let $path = '/export/home/psadmin/scripts/'             
>         let $file = 'sh ' || $path || 'cbgl0007.sh'
>       
>         call system using $file #status3
>         
>         if #status3 <> 0
>                 display ' call status: ' noline
>                 display #status3
>          end-if
>         if #status3 = 0
>                 display 'Unix script Executed'
>         end-if
> 
> End-Procedure
> 
> Now I need a similar or any script, that when the SQR is run on NT
> and
> after it creates an
>  output file in a specific folder in DEV, it should get transferred
> to
> a folder in TST
> or vice versa.
> Pls let me know
> 
> Thanks
> Raghav
> 
> _______________________________________________
> sqr-users mailing list
> sqr-users@sqrug.org
> http://www.sqrug.org/mailman/listinfo/sqr-users
> 

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users