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

[sqr-users] Issue with the FTP script in deleting files in UNIX



Hi Datta,

I have one more problem with the ftp script (UNIX).
After the output file is created and transferred to NT,
the file should get deleted in UNIX as per the script ($L16).
But for some reason this delete isnt working. Can you 
suggest me what I can do?

here is the script:
 let $file-path = 'cd /d01/psadmin/out/payroll'  
        let $L1 = 'HOST=' || '''172.21.1.109'''
        let $L2 = 'USER=' || '''psadmin'''
        let $L3 = 'PASSWD=' || '''psadmin'''
        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/PyrReports'
        let $L9 = 'prompt'
        let $L10 = 'mput ' || '*' || $prcs_process_instance || '*'
        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 /d01/psadmin/out/payroll'
        let $L16 = 'delete ' || $Dept_Id || '_' || 'cbgl0008_' ||
$prcs_process_instance || '.csv'
        let $L17 = 'exit 0'
        let $L18 = 'else'
        let $L19 = 'echo' || '"Transfered failed"'
        let $L20 = 'exit 1'
        let $L21 = 'fi'

Thanks,
Raghav


On 4/25/05, sqr-users-request@sqrug.org <sqr-users-request@sqrug.org> wrote:
> Send sqr-users mailing list submissions to
>        sqr-users@sqrug.org
> 
> To subscribe or unsubscribe via the World Wide Web, visit
>        http://www.sqrug.org/mailman/listinfo/sqr-users
> or, via email, send a message with subject or body 'help' to
>        sqr-users-request@sqrug.org
> 
> You can reach the person managing the list at
>        sqr-users-owner@sqrug.org
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of sqr-users digest..."
> 
> 
> Today's Topics:
> 
>   1. Re: Transferring output file within environments using    SQR
>      when the SQR Report is run on NT (Dattatraya Shetty)
>      (Raghvendra Dharwada)
> 
> 
> 
> ---------- Forwarded message ----------
> From: Raghvendra Dharwada <dharwada@gmail.com>
> To: sqr-users@sqrug.org
> Date: Sun, 24 Apr 2005 21:08:53 -0700
> Subject: [sqr-users] Re: Transferring output file within environments using 
>SQR when the SQR Report is run on NT (Dattatraya Shetty)
> Hi Datta,
> 
> Thank you very much for the reply regarding the transfer of files. I
> will try as per your suggestion
> 
> Raghav
> 
> On 4/23/05, sqr-users-request@sqrug.org <sqr-users-request@sqrug.org> wrote:
> > Send sqr-users mailing list submissions to
> >        sqr-users@sqrug.org
> >
> > To subscribe or unsubscribe via the World Wide Web, visit
> >        http://www.sqrug.org/mailman/listinfo/sqr-users
> > or, via email, send a message with subject or body 'help' to
> >        sqr-users-request@sqrug.org
> >
> > You can reach the person managing the list at
> >        sqr-users-owner@sqrug.org
> >
> > When replying, please edit your Subject line so it is more specific
> > than "Re: Contents of sqr-users digest..."
> >
> >
> > Today's Topics:
> >
> >   1. Re: Transferring output file within environments using    SQR
> >      when the SQR Report is run on NT (Dattatraya Shetty)
> >   2. RE: Transferring output file within environments  usin g SQR
> >      when the SQR Report is run on NT (jeff_molloy@adp.com)
> >
> >
> >
> > ---------- Forwarded message ----------
> > From: Dattatraya Shetty <datta_shetty@yahoo.com>
> > To: "This list is for discussion about the SQR database reporting language 
>from Hyperion Solutions." <sqr-users@sqrug.org>
> > Date: Fri, 22 Apr 2005 06:13:26 -0700 (PDT)
> > 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
> >
> >
> >
> > ---------- Forwarded message ----------
> > From: jeff_molloy@adp.com
> > To: sqr-users@sqrug.org
> > Date: Fri, 22 Apr 2005 09:32:37 -0400
> > Subject: RE: [sqr-users] Transferring output file within environments usin 
>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
> >
> >
> >
> 
> 
> _______________________________________________
> sqr-users mailing list
> sqr-users@sqrug.org
> http://www.sqrug.org/mailman/listinfo/sqr-users
> 
> 
>

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