[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 environmentsusin g SQR when the SQR Report is run on NT



Also, if you do not want to map the drive, just put the
\\TSTSERVER\sharedrive in double quotes.  That will work also.

"\\TSTSERVER\sharedrive"

Jeff Molloy

 
 

-----Original Message-----
From: Dattatraya Shetty [mailto:datta_shetty@yahoo.com] 
Sent: Friday, April 22, 2005 9:13 AM
To: This list is for discussion about the SQR database reporting language
from Hyperion Solutions.
Subject: Re: [sqr-users] Transferring output file within environments using
SQR 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

-----------------------------------------
This message and any attachments are intended only for the use of the
addressee and may contain information that is privileged and confidential.
If the reader of the message is not the intended recipient or an authorized
representative of the intended recipient, you are hereby notified that any
dissemination of this communication is strictly prohibited. If you have
received this communication in error, notify the sender immediately by
return email and delete the message and any attachments from your system.



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