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

Re: How are others dealing with Process Scheduler overiding setenv.sqc



I haven't seen any other responses so I thought I would give it a shot.  

In SETENV.SQC we set up 2 substitution variables - the normal {FILEPREFIX} and another called {FTPPREFIX} specifically to define a directory for FTPing files so that FTP is using its own UserID and Password so as to improve security.  FTP's access is severly restricted.

More directly to the point, we set up {FILEPRFIX} in SETENV.SQC to specify a separate directory for each user and for each database instance within each user.  So, when I as a developer am testing, datafiles are stored in my directory under the development directory e.g. /usr/don/dev/.  Each developer is then isolated from other developers as well as production.  I am not sure of the details of how this all happens on the UNIX side - it is a combination of UNIX environment variables, SQR compiler substitution variables, etc as well as the search path from the -i flag.  There is no technical reason that you cannot "hard-code" a directory structure but it works really well to have it automatically adjusted for client vs. server, different users vs. Process Scheduler, and development vs. QA vs. Production databases.  This was not easy to get set up and working properly.  Another problem was developers knowing where to find their files as they changed environments.

Reports and log files are handled in the same fashion during development.  In the Process Scheduler all reports are printed since that is all normal users are allowed to do.

Don



>>> Larry Oltmanns <oltma004@TC.UMN.EDU> 07/29 2:16 PM >>>
How are others dealing with this issue since it is a Enterprise problem.
When you launch a process like CCLTRGEN.SQR and the process scheduler
takes your output parameters, like for example I want the output to go
to /reports/sa/admissions/act/  when placing this in the
process scheduler and running the job ccltrgen.sqr, the output goes to
the /var/tmp directory. As demonstrated below in the attached
documentation. Therefore, how are we dealing with this issue of
setenv.sqc making all the calls in the UNIX environment. Are there
dynamic
SQC logic that seems to work best, or are many solution just Shell
Script copying and moving, or are the setenv.sqc and ccltrgen.sqr's of
the world modified for each instance of the problem.




Larry Oltmanns wrote:

>  Thanks Brian, your on the Mark,  the likly hood of Solaris placing
> the /usr/tmp  into var/tmp
> with an alias is a very good observation, and the FILEPREFIX variable
> which as I have attached below
> show that in fact this is the issue. I can appreciate using search
> engines "find" on a LAN for these
> types of problems are just that an egg hunt. To take it a step further
> I think if hundreds of letters would be  comming through CCLTRGEN.sqr
> then it would make sense to have set directory structure and output
> variables setup.  As an example:
>
> In CCLTRGEN we could have  move  '{FILEPREFIX_NEW}' to $Filename [ as
> a mod ] or leave it.
>
>
>                                        setenv.sqc
> for UNIX we could have #define FILEPREFIX_NEW
> /reports/sa/adm_sys_cntl/act/
> for UNIX we could have #define FILEPREFIX_NEW
> /reports/sa/adm_sys_cntl/eos/
> for UNIX we could have #define FILEPREFIX_NEW
> /reports/sa/adm_sys_cntl/gre/
> for UNIX we could have #define FILEPREFIX_NEW
> /reports/sa/adm_sys_cntl/sat/
> for UNIX we could have #define FILEPREFIX_NEW
> /reports/sa/adm_sys_cntl/sss/
>
>
> 1)  Question what is that logic like "Using the SQR getenv function to
> set  the  directory dynamically ".
>       If I had a directory like the one above (i.e.
> /reports/sa/adm_sys_cntl/)
>
> 2)  Question what  UNIX  environment variables were changed in your
> findings.
>
>
>
> =========extracted from ccltrgen.sqr ===================
>
> begin-procedure Print-Record
>
>   if #First_Print
>      move 0 to #First_Print
>      move '{FILEPREFIX}'   to   $FileName
>      concat 'CC'           with $FileName
>      concat $Letter_Cd     with $FileName
>      concat '.'            with $Filename
>      evaluate $xtrct_file_type
>        when = 'W'
>          concat 'LTR'      with $Filename
>          break
>        when = 'J'
>          concat 'DAT'      with $FileName
>      end-evaluate
>      concat '{FILESUFFIX}' with $Filename
>      let $Filename = lower($Filename)
>
> ====extracted from ========== setenv.sqc ======= enterprise testing
> environment=============
>
> #ifdef UNIX
> #define FILEPREFIX /usr/tmp/
> #define FILESUFFIX
> #endif
> ===========================SQR Users
> Group=================================
>
> Apologies in advance to non-PeopleSoft users.
>
> I've been out a few days, sorry if this has already been answered.  In
>
> PeopleSoft, you can easily direct the output of SQR's that generate
> listing in the "normal" methods: i.e. those whose destinations you
> specify with the -f option on the SQR command line.  However, there
> are
> a number of PeopleSoft SQR programs which generate files, not
> listings,
> and the name and/or location of the file is set in the program itself.
>
> Typically, these SQR's use the substitution variable FILEPREFIX to set
>
> the directory name.  This FILEPREFIX is set in the setenv.sqc and for
> UNIX (in a vanilla install) is defined as /usr/tmp.  In some UNIX
> flavors, /usr/tmp is a link/alias for /var/tmp.
>
> I would suggest a quick scan of the offending SQR (ccltrgen) to see
> where it is setting up the file name for your letters file.  I suspect
>
> you will find it uses FILEPREFIX.  If you don't like /usr/tmp then you
>
> have a couple of options:
> 1. Modify setenv.sqc.  Unfortunately this is a global setting for ALL
> sqr's which use this sqc and you will not be able to set this value
> dynamically (e.g. different settings for test and production) without
> creating separate sqc's.
> 2. Modify the SQR and put in your own file naming logic.  We've taken
> this approach a couple of times.  We set some UNIX environment
> variables
> and use the SQR's getenv function so that we can set the directory
> dynamically.
>
>
>
> --
> Brian Murray                      Brian.C.Murray@vanderbilt.edu 
> Office of Administrative Systems
> Vanderbilt University