TDSVC

 

 

NOTE - Use your Browsers BACK Button to return to prior page or CLICK here.

  Supervisor Analyzer... What is it? Why is it here?
So far the Utilities I've placed on this site are strictly for technical analysis of source code (SQR, COBOL, Application Engine)... For a functional person these may not be of any value... (although some functional people I know have some great technical skills - such as my great friends and associates Delores and Dave!) Quite often I receive e-mails asking for advice on SQR related issues... One I recieved recently had to do with PeopleSoft H/R... and the flowcharting of Supervisors and subordinates... since TDSQR (SQR Analyzer) is very similar in functionality I modified it to suit this particular purpose (a 15 minute job)... The Supervisor Analyzer program can be used as a shell for other pseudo-recursive flowcharting tasks...
   Download TDSVC.SQR
ftgull01.jpg (3568 bytes) Click on the seagull to download the TDSVC program. It requires no additional SQC files since it uses the standard PeopleSoft delivered files such as setenv, setup02a, stdhdg01, curddttm and datetime.

   Supervisor Analyzer Demonstration... and a "Forest Lake" scene...
pnlake01.jpg (9195 bytes) Let's take a look at some test data (found in PS 6.0 SQLBase version)... listed below you'll find the Supervisors and their subordinates... We're going to stack them in order like the turtles on this log...
TDSVC Supervisor Analyzer
 
Enter High-Level Manager ID: 8001
 
#Ctr   Supervisor   Emplid   Empl_Rcd# 
   1   8001         8102             0
   2   8001         8315             0
   3   8001         8501             0
   4   8001         8600             0
   5   8001         I002             0
   6   8001         I003             0
   7   8001         LT007            0
   8   8001         LT011            0
   9   8001         LT011            1
  10   8102         8406             0
  11   8102         8409             0
  12   8102         8516             0
  13   8102         G016             0
  14   8102         LC0001           0
  15   8102         LT009            0
  16   8315         8101             0
  17   8315         8530             0
  18   8315         I001             0
  19   8406         8517             0
  20   8406         8664             0
  21   8406         8668             0
  22   8406         8730             0
  23   8406         8761             0
  24   8406         G010             0
  25   8516         8317             0
  26   8516         8421             0
  27   8516         8666             0
  28   8516         8766             0
  29   8516         8803             0
  30   8516         8806             0
  31   8516         8860             0
  32   8516         GU01             0
  33   8516         LT001            0
  34   8516         LT002            0
  35   8516         LT003            0
  36   8101         8105             0
  37   8101         8225             0
  38   8101         8301             0
  39   8101         8592             0
  40   8101         8601             0
  41   8101         8667             0
  42   8101         8850             0
  43   8421         8832             0
  44   8225         8201             0
  45   8225         8202             0
  46   8225         8521             0
  47   8225         LT004            0
  48   8201         8651             0
  49   8201         8773             0
  50   8201         8835             0
  51   8201         8853             0
  52   8201         LC0001           1
  53   8201         LT008            0
  54   8201         LT010            0
  55   8202         8203             0
  56   8202         8513             0
  57   8202         8515             0
  58   8202         8663             0
 
                                                                                                   
pnlake02.jpg (7548 bytes) In the list above you can see employee 8102 reports to the main supervisor 8001... employee 8406 reports to 8102... employee 8517 reports to 8406... the entire list needs to be organized in this fashion...

   Supervisor Analyzer Output
pnlake03.jpg (7813 bytes) Below is the first page of our output listing... Notice the relationships have been organized in a tree formatted listing... this is a good graphical representation of an organization's reporting structure...
TDSVC  Report ID:  TDSVC    SUPERVISOR ANALYZER                 Page No.  1
                                                          Run Date 07/28/99
                                                          Run Time 11:39:04
===========================================================================
Supervisor Structure
===========================================================================

     8001 - Schumacher,Simon
          8102 - Sullivan,Theresa
               8406 - Davis,William D.
                    8517 - Holden,Peter
                    8664 - Carroll,Brucest
                    8668 - O'Brien,Michael
                    8730 - Smithers,Jasmine
                    8761 - Vallero,Joaquin
                    G010 - Masters,Jason
               8409 - Westlund,Julie
               8516 - Akers,Danielle
                    8317 - Norton,Terry
                    8421 - Jaegar,Annette
                         8832 - Tanner,Doris
                    8666 - Engel,Roberta
                    8766 - Self,Nancy
                    8803 - Jeffery,Anita
                    8806 - Smith,Douglas
                    8860 - Lester,Martin
                    GU01 - Forest,John James
                    LT001 - Santos,Charles A.
                    LT002 - Hiromoto,Seiko
                    LT003 - Souza,Isobel
               G016 - Schofield,Ashley
               LC0001 - Hann,Kevin
               LT009 - Foster,Gloria
          8315 - Aitken,Hugh
               8101 - Penrose,Steven
                    8105 - DeHaven,Joanne
                    8225 - Sterling,Sharon
                         8201 - Rifkin,Cheri
                              8651 - Ortiz,Lupe
                              8773 - Smithers,Dave
                              8835 - Osborne,Edwin
                              8853 - Young,Jennifer
                              LC0001 - Hann,Kevin
                              LT008 - Garvey,Ernest B.
                              LT010 - Featherstone,Raymond
                         8202 - Hadley,Charles
                              8203 - Webb,Floren
                              8513 - Garvey,Elizabeth
                              8515 - Brown,Margot
                              8663 - Smith,Samantha
                         8521 - Adamson,Sonja
                         LT004 - Beecher,Brenda

============================================================================
Supervisor Analyzer  by Tony DeLia     tdelia@erols.com
 
                                                                                                   
pnlake04.jpg (11353 bytes) Our output file is now in the organization chart format we need... it's much easier to read in this format... and can easily be placed into Powerpoint or some other package...

   Supervisor Analyzer Source Code
pnlake05.jpg (6881 bytes) You can see the Source Code is strikingly similar to my SQR Analyzer... The array is loaded with all employees down thru the "chain of command"... It is then analyzed and flowcharted in the same manner as my SQR, COBOL and A/E utilities... the algorithm may be used for many similar purposes...
!!**********************************************************************
!*                                                                    *
!*       MODULE:  TDSVC.SQR                                           *
!*       AUTHOR:  TONY DELIA.                                         *
!*         DATE:  07/28/1999.                                         *
!*       SYSTEM:  TD SQR UTILITY SERIES.                              *
!*         DESC:  SUPERVISOR ANALYZER.                                *
!*                                                                    *
!**********************************************************************
!*                                                                    *
!*        INPUT:  <Enter High Level Manager ID>                       *
!*                                                                    *
!**********************************************************************
!*                                                                    *
!*         NOTE:  Circular References must be resolved.               *
!*                i.e. A reports to B... B reports to A...            *
!*                Will loop until array runs out of space.            *
!*                                                                    *
!**********************************************************************
!*                                                                    *
!*        LEGAL:  CONFIDENTIALITY INFORMATION.                        *
!*                                                                    *
!*                This module is the original work of Tony DeLia. It  *
!*                can be considered ShareWare under the following     *
!*                conditions.                                         *
!*                                                                    *
!*                A - The author's name (Tony DeLia) remains on any   *
!*                    and all versions of this module.                *
!*                B - Any modifications must be clearly identified.   *
!*                C - A "vanilla" copy of this module must be kept    *
!*                    alongside any revised versions.                 *
!*                                                                    *
!**********************************************************************
!*                                                                    *
!*      WEBSITE:  http://www.sqrtools.com                             *
!*                                                                    *
!*                Questions/Comments: tdelia@erols.com                *
!*                                                                    *
!**********************************************************************

#include 'setenv.sqc'        ! Set environment

!**********************************************************************
!*       Setup Procedure                                              *
!**********************************************************************

begin-setup

#Include 'setup02a.sqc'      ! Printer and page-size init landscape

end-setup

!**********************************************************************
!*       Headings                                                     *
!**********************************************************************

begin-heading 08

#include 'stdhdg01.sqc'

print '='                              ( +1,  1,175) fill

print ' '                              ( +1,  1,  0)
print 'Supervisor Structure'           (  0,  1,  0)

print '='                              ( +1,  1,175) fill

end-heading

!**********************************************************************
!*       Footing                                                      *
!**********************************************************************

begin-footing 04

print ' '                              ( +1,  1,  1)
print '='                              ( +1,  1,175) fill
print 'Supervisor Analyzer'            ( +1,  1,  0)
print 'by Tony DeLia'                  (  0, +2,  0)
print 'tdelia@erols.com'               (  0, +5,  0)

end-footing

!**********************************************************************
!*       Mainline Processing                                          *
!**********************************************************************

begin-report

  do Init-DateTime
  do Get-Current-DateTime

  do Init-Routine
  do Process-Phase1         ! Build Supervisor/Subordinate List
  do Process-Phase2         ! Produce Supervisor Flowchart

end-report

!**********************************************************************
!*       Initialization Routine                                       *
!**********************************************************************

begin-procedure Init-Routine

let $ReportTitle  = 'Supervisor Analyzer'
let $ReportId     = 'TDSVC'

move $AsOfToday to $AsOfDate

display $ReportId    noline
display ' '          noline
display $ReportTitle
display ' '

input $MGRid maxlen=11 'Enter High-Level Manager ID'

display $MGRid

display ' '

! Supervisor Table

create-array name=SVCmtx size=1000 field=SVCid:char        -
                                   field=SVCsub:char

let $SVC_S  = '@START'
let #SVCmax = 999
let #SVCptr = 0
let #SVCctr = 0

put $SVC_S $MGRid into SVCmtx (0) SVCid SVCsub

! STACK pointers

create-array name=STACK  size=30 field=STACKptr:number     -
                                 field=STACKsub:char

let #STACKmax = 29

end-procedure

!**********************************************************************
!*       Process Phase 1 - Select/Load Employee Population            *
!**********************************************************************

begin-procedure Process-Phase1

let $phase     = '2'

while #SVCptr <= #SVCctr

   let $SVCid  = SVCmtx.SVCsub (#SVCptr)

   do  Populate-Array

   let #SVCptr = #SVCptr + 1

end-while

display ' '

end-procedure

!**********************************************************************
!*       Populate Array (w/subordinate entries)                       *
!**********************************************************************

begin-procedure Populate-Array

begin-select

a.emplid
a.empl_rcd#

   let #SVCctr                 = #SVCctr + 1
   let SVCmtx.SVCid  (#SVCctr) = $SVCid
   let SVCmtx.SVCsub (#SVCctr) = &a.emplid

   !   Display Formatting Below (RPAD for alignment)

   let $DSPid                  = rpad($SVCid,10,' ')
   let $DSPsub                 = rpad(&a.emplid,10,' ')

   display #SVCctr        9999   noline
   display '   '                 noline
   display $DSPid                noline
   display '   '                 noline
   display $DSPsub               noline
   display '   '                 noline
   display &a.empl_rcd#   9999

 from ps_employment     a
where a.supervisor_id = $SVCid
order by a.emplid

end-select

end-procedure

!**********************************************************************
!*       Process Phase 2 - Supervisor Structure                       *
!**********************************************************************

begin-procedure Process-Phase2

let $phase   = '2'

let #stack   = 1

while #stack > 0

   get #idx $srch from STACK  (#stack) STACKptr STACKsub

   get $svc $sub  from SVCmtx (#idx)   SVCid    SVCsub

   let #ptr  = #idx
   let #idx  = #idx + 1

   put #idx into STACK (#stack) STACKptr

   if  $svc  = $SVC_S  and  #stack = 1
   or  $svc  = $srch   and  $svc <> ''

       let $pad   = ' '
       let $pad   = rpad($pad,(#stack*5),' ')

       do Select-Name

       print $pad                      ( +1,  1,  0)
       print $sub                      (  0, +0,  0)
       print $subdesc                  (  0, +0,  0)

       let #stack = #stack + 1
       let #idx   = 0

       put #idx $sub into STACK (#stack) STACKptr STACKsub

   end-if

   if #idx  > #SVCctr

      let #stack = #stack - 1

   end-if

end-while

end-procedure

!**********************************************************************
!*       Select Name (or other stuff)                                 *
!**********************************************************************

begin-procedure Select-Name

let $subdesc = ''

begin-select

b.name

  let $subdesc         = ' - ' || &b.name

 from ps_personal_data   b
where b.emplid         = $sub

end-select

end-procedure

!**********************************************************************
!*       Include Members:                                             *
!**********************************************************************

#Include 'curdttim.sqc'  !Get-Current-DateTime procedure
#Include 'datetime.sqc'  !Routines for date and time formatting
                         !Init-DateTime procedure

!**********************************************************************
!*       End of Program                                               *
!**********************************************************************
                                                                                                   

   This concludes another SQRTOOLS page...
pnlake06.jpg (8625 bytes) This completes another section of SQRTOOLS.COM... and the "Forest Lake" scene is complete...

   And here's the complete "Forest Lake"...

pnlake00.jpg (72089 bytes)

   Feedback
ftoct01.jpg (12389 bytes) I would appreciate any feedback you may have on this site. Send mail to tdelia@erols.com or click on the Octopus.

Tony DeLia  -  Updated August 01, 1999