Thursday, December 5, 2019

Crystal Check Reprint Utility - Archive

Here's something for the Archives. Several years ago PeopleSoft dropped support for Crystal Checks in favor of BI Publisher. Prior to that our organization switched from in-house printing to an external vendor (Dec'2012). Nonetheless this is a pretty slick solution I developed previously for both AP Paycycle Automation as well as the ability to quickly reproduce any batch of checks (or portion). No need to reset Paycycle Manager flags or other settings.

The key to the solution is the RUN_Init() functionality I created when I initially started (July'2004). This allows me to stage a Process Scheduler Request from virtually any application. A good example of this capability is the SQL*Engine @RUN= directive I highlighted in a previous post. I created a simple utility TDCHKPRT.SQR to read one or more reprint requests and send the parameters to the staging routine. That's it...

It takes minutes to respond to an emergency request from Cash Management & quickly reproduce the checks they need.

An actual scenario:
On 05/11/2010 there was a hardware issue with the NSS3 Check Printer. Four Check Print jobs were left in the print queue that had to be re-staged & directed to another printer (NSS). Using the process instance numbers I could extract the original run control parameters to reprocess the Crystal checks. 



ABOVE: The four jobs that need to be re-queued. To obtain the parameters of each click on “Details” followed by the “Parameters” hyperlink (or query the Process Request tables directly).

Process Request Parameters:

All the information needed to reprint the check batch.
ABOVE: A view of the Command Line details.

The Command Line parameters must be copied & extracted for use in the TDCHKPRT SQR program. The program has two sets of $RCX variables – one for the runtime flags the other for the Crystal Report parameters. The $RCX_OP (Output) flag has been changed to “NSS” instead of the original -OPNSS3 setting (above). All other flags are the same. The positional parameters at the end of the command line are fed in sequence using the $RCX_P01 thru $RCX_P08 variables (#RCX_ctr passes the parameter count of 8).

Check Reprint Utility - TDCHKPRT:


Below is a portion of code that sets the required parameters to run a Crystal Report instance through Process Scheduler. For demonstration purposes the variables have been set to literal values (hard-coded) instead of looping through a file containing the 4 required runs for this example. You can see how the parameters line up with the information from the original process request along with the printer redirection (NSS).
 
let $I_gen                 = '3'
let $I_prcs                = 'APY2021-'
let $I_id                  = 'PSBATCH'
let $I_rc                  = '000001'

let #RCX_ctr               = 8            
let $RCX_P01               = '000001'        
let $RCX_P02               = '1401'
let $RCX_P03               = '10100'
let $RCX_P04               = 'JP001'
let $RCX_P05               = '0002'
let $RCX_P06               = 'CHK'
let $RCX_P07               = '0200121041'
let $RCX_P08               = '0200121260'             
                            
let $RCX_RP                = 'CHECK5'
let $RCX_OT                = '3'
let $RCX_OP                = 'NSS'
let $RCX_SVR               = 'PSNT'
let $RCX_LG                = 'ENG'
  
do RUN_Init($I_gen, $I_prcs, $I_id, $I_rc, #O_pi)

show 'PI: ' #O_pi


<SNIP>

#include 'xx_tdf.sqc'    !TD Custom SQR Function Library
#include 'xx_run.sqc'    !TD Custom Process Scheduler Request
#include 'xx_idb.sqc'    !TD Custom Interface API


The included custom SQC files perform a variety of tasks including the staging of a new process request (XX_RUN.SQC). The XX_IDB SQC facilitates Interface File Integration - the file containing the required check print specifications is dropped in a target folder & processed automatically.

File Input:

Below is a file containing the specific run parameters of each group of checks that needs to be run along with the redirected check printer destination - NSS3 to NSS.

000001 1401 10100 JP001 0002 CHK 0200121041 0200121260 PSNT  NSS
000001 1401 12000 JP001 0006 CHK 0600028481 0600028500 PSNT  NSS
000001 1401 23700 JP001 0046 CHK 4600001679 4600001685 PSNT  NSS
000007  455 13100 JP001 0011 CHK 1100074112 1100074387 PSNT  NSS



Within the file the exact lo/hi range of check numbers may be designated or a smaller portion if that's what is required. A possible scenario includes a smaller group was damaged after printing & needs to be reprinted. Maybe a single check had coffee spilled on it. The principal remains the same.

RUN_Init() - Load Process Scheduler Request:

A small glimpse into the XX_RUN.SQC module - a very small glimpse!

!**********************************************************************
!*                                                                    *
!*       MODULE: XX_RUN.SQC                                           *
!*       AUTHOR: TONY DELIA.                                          *
!*         DATE: 03/23/2005.                                          *
!*       SYSTEM: NSS/ADVANCE PUBLICATIONS - PS 8.X HR/FIN.            *
!*         DESC: STAGE PROCESS SCHEDULER REQUEST.                     *
!*                                                                    *
!**********************************************************************
!*                                                                    *
!*       TABLES: ps_prcssequence     - Update, Select                 *
!*               psdbowner           - Select                         *
!*               psprcsruncntl       - Select                         *
!*               ps_prcsruncntldtl   - Select                         *
!*               ps_prcsruncntldist  - Select                         *
!*               ps_prcsruncntleopt  - Select                         *
!*               ps_prcsdefn         - Select                         *
!*               ps_prcstypedefn     - Select                         *
!*               ps_prcsjobitem      - Select                         *
!*               ps_prcsrqstdist     - Insert                         *
!*               ps_cdm_auth         - Insert                         *
!*               ps_cdm_list         - Insert                         *
!*               psprcsrqsttext      - Insert                         *
!*               psprcsparms         - Insert                         *
!*               psprcsque           - Insert, Update                 *
!*               psprcsrqst          - Insert, Update                 *
!*               ps_xx_rb_uri        - Select                         *
!*                                                                    *
!**********************************************************************

!**********************************************************************
!*                                                                    *
!*       GLOBAL VARIABLES FOR CRYSTAL REPORTS                         *
!*       ===========================================================  *
!*       #RCX_CTR    - PARAMETER COUNT (1 THRU 10)                    *
!*       $RCX_P01    - PARAMETER1 ($RCX_P01 thru $RCX_P10 if needed)  *
!*       $RCX_SVR    - SERVER (PSNT [default] or PSNT2)               *
!*                                                                    *
!*       Optional Report Flags:                                       *
!*       $RCX_RP     - REPORT NAME.                                   *
!*       $RCX_OT     - OUTPUT TYPE.                                   *
!*       $RCX_OP     - OUTPUT PATH.                                   *
!*       $RCX_LG     - LANGUAGE CODE.                                 *
!*                                                                    *
!*       $RCX_CLEAR  - CLEAR ALL PARMS UPON EXIT (Y/N - Y=Default).   *
!*                                                                    *
!*       RUN DATE/TIME GLOBAL VARIABLE:                               *
!*       $RCX_dttm   - REQUEST DATE/TIME (YYYYMMDD_HH:MI)             *
!*                                                                    *
!**********************************************************************


This utility served me (and Cash Management) well for many years!