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

Re: [sqr-users] SQR and PS question



We created azn SQR to find the path and extension for files.
Essentially it is this:

! ******************************************************
! SUTOOLS.SQC
! ******************************************************
! Repository for various useful SU Developed SQC routines 
! that we may need in a more general sense
! ******************************************************

! ******************************************************
! get-sqr-output-path
! Returns the path where output can be stored in order
! for the Report Repository to find it.
! Use as follows: 
!     Do get-sqr-output-path($sqr-report, $OUTPATH)
! $OUTPATH will contain the path.  Append your filename
! ie Let $OUTPUTNAME = $OUTPATH || 'filename.txt'
! ******************************************************
begin-procedure get-sqr-output-path($INPATH, :$OUTPATH)
  let #length_sqr_report = length($INPATH)
  let #y = #length_sqr_report
  let #sqr_dir_end = 0
! Search variable to find last occurrence of '/' or '\'
  while #y > 0 and not #sqr_dir_end 
     let $search_char = substr($INPATH,#y,1)
     if $search_char = '/' or $search_char = '\'
        let #sqr_dir_end = #y
        break
     end-if
     if not #sqr_dir_end
        subtract 1 from #y
     end-if
  end-while
! found last '/' - this is the path we need for files
  let $OUTPATH =  substr($INPATH,1,#y)
end-procedure

! ******************************************************
! get-sqr-output-extension
! Returns the file extension of the file being generated
! This can be used in concert with the above function
! when trying to force report names.
! Use as follows: 
!     Do get-sqr-output-extension($sqr-report, $OUTEXTENSION)
! $OUTEXTENSION will contain the file extension (does NOT include
! the period) ie LIS, PDF, etc.  Append this to your filename
! ie: 
!  Do get-sqr-output-path($sqr-report, $OUTPATH)
!  Do get-sqr-output-extension($sqr-report, $OUTEXTENSION)
!  Let $OUTPUTNAME = $OUTPATH || 'filename.' || $OUTEXTENSION
! ******************************************************

begin-procedure get-sqr-output-extension($INPATH, :$OUTEXTENSION)
show $INPATH
  let #length_sqr_report = length($INPATH)
  let #y = #length_sqr_report
  let #sqr_dir_end = 0
! Search variable to find last occurrence of '.'
  while #y > 0 and not #sqr_dir_end 
     let $search_char = substr($INPATH,#y,1)
     if $search_char = '.'
        let #sqr_dir_end = #y
        break
     end-if
     if not #sqr_dir_end
        subtract 1 from #y
     end-if
  end-while
! found '.' - this is the path we need for files
  let $OUTEXTENSION = substr($INPATH,#y + 1,length($INPATH)-#y + 1)
end-procedure


******************************
Larry Roux
Syracuse University
lroux@syr.edu
*******************************

>>> star111lists@mindspring.com 08/18/03 11:32AM >>>
You can extract the path from $sqr-report.  Using that path will put
the file into a location where the the agent will pick it up and move
it to the correct directory along with the .lis and .log files. Users
will then have click access to it from the web page.  Note that I
believe this only works after tools version 8.16. Earlier versions
only picked up the report files.


On Mon, 18 Aug 2003 10:06:25 -0400, you wrote:

>How can I make a report use the Report Distribution agent.
> 
>Example:-) I have a DDP report that currently generates a file on a share to
>a UNIX box. What I would like to do is have the directed output use the
>prcs/output_log/$PROCESS_ID$ for the current process so that the file is
>FTP'ed to the Report Distribution site instead of being on some share.
> 
>Does anyone know of any global variable in SQR for PS that references the
>process id folder location for report distribution? Or how to do what I want
>to do easily.
> 
>Steve
> 


_______________________________________________
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