Skip to content

Dave's Exampls #129

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
May 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,262 changes: 1,262 additions & 0 deletions endevor/Field-Developed-Programs/PackageBuilder.moveout

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
/* REXX */

TRACE Off

/* Performs masking on DB2 DDL statements */
/* Variable names in mask may use an underscore to */
/* replace values preceeded by multiple words. */
/* Masking characters: */
/* */
/* ? Copies a corresponding single character from source */
/* field to target field */
/* */
/* * Copies 0 or more corresponding source characters */
/* to target field */
/* */
/* - Removes the single character */
/* */

WhatDDName = 'DB2MASK2'
/* If DB2MASK# is allocated? If yes, then turn on Trace */
isItThere = ,
BPXWDYN("INFO FI(EDCHKDD) INRTDSN(DSNVAR) INRDSNT(myDSNT)")
If isItThere = 0 then Trace r
MY_RC = 0

/* DB2 Masking routine for named output */
/* and possible output appending */
Arg MYOUTDD

Mask. = ''
/* Cature Mask names ane values */
/* Read Endevor's Masking rules in the MASKING data */
"EXECIO * DISKR MASKING (STEM mask. FINIS "

ListMaskWords = ''
Do m# = 1 to mask.0
msk = Strip(mask.m#)
posEqual = Pos('=',msk)
if posEqual = 0 then iterate ;
msk = overlay(' ',msk,posEqual)
text = Substr(msk,1,(posEqual-1))
if Words(text)/= 1 then iterate
MaskWord = Word(msk,1)
Upper MaskWord
ListMaskWords = ListMaskWords MaskWord
posValue = Wordindex(msk,2)
MaskValue = Strip(Substr(msk,posValue))
Say 'Found Mask for' MaskWord '=' MaskValue
MaskValue = Strip(MaskValue,"B",'"')
MaskValue = Strip(MaskValue,"B","'")
Mask.MaskWord = MaskValue
End ; /* Do m# = 1 to mask.0 */

Say Copies('-',70)

/* Apply mask values to Bind statement */
/* Read the DB2#STMT */
"EXECIO * DISKR DB2#STMT (Stem db2. Finis "
/* Scan each line of the Bind Statement */
Do b# = 1 to db2.0
DB2Statement = db2.b#
If Words(DB2Statement) = 0 then Iterate ;

/* Scan each Word of the Bind Statement */
Do m# = 1 to Words(ListMaskWords)
MaskWord = Word(ListMaskWords,m#)
SrchWord = Translate(MaskWord,' ','_') || ' '
WhereMaskString = Pos(SrchWord,DB2Statement)
If WhereMaskString < 1 then Iterate
OrigMask = Mask.MaskWord
Mask = OrigMask
If Mask = '' then iterate
Call DoSubstitution
Leave
End; /* Do m# = 1 to Words(ListMaskWords) */

End /* Do b# = 1 to db2.0 */

/* Write masked output to MYOUTDD */
/* (Do not close output to allow appending of data */
"EXECIO * DISKW" MYOUTDD "(Stem db2. "

EXIT (MY_RC) ;

DoSubstitution :

Say 'Before:' DB2Statement
Sa= DB2Statement
Sa= WhereMaskString
Sa= MaskWord

/* Find Starting and Ending positions of the clause */
/* to be masked */
maskEnd = WhereMaskString + length(MaskWord) - 1
ValueStarts = ,
maskEnd + WordIndex(Substr(DB2Statement, maskEnd+1),1)
BeforeChange = Word(Substr(DB2Statement, ValueStarts),1)
valueEnd = ValueStarts + Length(BeforeChange) - 1

/* Apply Mask to clause within the DB2 bind */
/* This routine applies values in 'Mask' */
/* to the value in 'BeforeChange' */
SupportedWildCards = '?*-'
AfterChange = BeforeChange

If Mask = ' ' then Mask ='*' ;
Howlong = Length(Mask) + Length(AfterChange)
Do char# = 1 to Howlong
Maskchar = Substr(Mask,char#,1) ;
If maskchar = " " then Leave ;
If maskchar = "?" then iterate ;
If maskchar = "*" then,
Do
tail = Substr(Mask,char# + 1)
Mask = AfterChange || tail;
char# = Max(char#,length(AfterChange) )
Iterate ;
End;
If maskchar = "-" then,
Do
tail = Substr(AfterChange,char# + 1)
if char# > 1 then,
head = Substr(AfterChange,1,char# - 1)
else,
head = ''
AfterChange = head || tail;
Iterate ;
End;
Maskchar = Substr(Mask,char#,1) ;
AfterChange = Overlay(Maskchar,AfterChange,char#)
If char# = Length(Mask) then,
AfterChange = Substr(AfterChange,1,char#)
End /* Do char# = 1 to Length(Mask) */

say 'Mask:' OrigMask
If ValueStarts > 1 then,
head = Substr(DB2Statement,1,ValueStarts -1)
Else head = ''
DB2Statement = head || AfterChange || ,
Strip(Substr(DB2Statement,valueEnd + 1 ));
Say 'After: ' DB2Statement
Say Copies('-',70)

db2.b# = DB2Statement

Return
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/* REXX */
/* Find Native Stored Procedure qualifier & name */
Arg WhatDD

"EXECIO * DISKR" WhatDD "( Stem Table. finis"
do # = 1 to Table.0
A = Table.#
B = pos('CREATE PROCEDURE ',A)
if B > 0 then do
C = pos('.',A)
C = C + 1
Value = substr(A,C,32)
Value = 'SPName ="' || Value || '"'
Say 'DB2SNAME:' Value
queue Value
exit
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/* REXX */
/*********************************************************************/
/* THIS UTILITY READS A SUPFI BATCH REPORT TO DETERMINE IF A */
/* STORED PROCEDURE EXISTS. */
/* RC=0 MEANS THE STORED PROCEDURE IS NEW. RC=1 MEANS IT EXISTS */
/*********************************************************************/
'EXECIO * DISKR FILEIN (STEM TABLE.'
DO # = 1 TO TABLE.0
IF POS('| 0 |',TABLE.#) > 0 THEN EXIT(0)
IF POS('| 1 |',TABLE.#) > 0 THEN EXIT(1)
END
SAY 'DB2SPCHK REXX ERROR: DID NOT FIND REPORT LINE'
EXIT(12)
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
CREATE PROCEDURE ????????.YIPPIE_KAY_YAY
(
OUT X CHAR(1) CCSID EBCDIC FOR SBCS DATA
)
VERSION V1
LANGUAGE SQL
DETERMINISTIC
MODIFIES SQL DATA
CALLED ON NULL INPUT
DYNAMIC RESULT SETS 0
DISABLE DEBUG MODE
PARAMETER CCSID EBCDIC
QUALIFIER YourQualifier
PACKAGE OWNER YourOwner
ASUTIME LIMIT 1000
COMMIT ON RETURN NO
INHERIT SPECIAL REGISTERS
WLM ENVIRONMENT FOR DEBUG MODE YourDb2WLM
CURRENT DATA NO
DEGREE 1
DYNAMICRULES RUN
APPLICATION ENCODING SCHEME EBCDIC
WITHOUT EXPLAIN
WITHOUT IMMEDIATE WRITE
WITHOUT KEEP DYNAMIC
ISOLATION LEVEL CS
OPTHINT ''
RELEASE AT COMMIT
REOPT NONE
VALIDATE RUN
ROUNDING DEC_ROUND_HALF_EVEN
DATE FORMAT ISO
DECIMAL( 15 )
FOR UPDATE CLAUSE REQUIRED
TIME FORMAT ISO
BUSINESS_TIME SENSITIVE YES
SYSTEM_TIME SENSITIVE YES
ARCHIVE SENSITIVE YES
APPLCOMPAT V12R1
CONCENTRATE STATEMENTS OFF
RETURN X;

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
See your site's CSIQCLS(ENBPIU00) member for the latest TableTool

Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
ESYMBOLS TITLE 'SITE-WIDE SYMBOLICS TABLE'
***********************************************************************
* COPYRIGHT (C) 2022 BROADCOM. ALL RIGHTS RESERVED. *
* NAME: ESYMBOLS *
* DESCRIPTION: Site-Wide Symbolics Definition Table *
* FUNCTION: Define symbolics for use in element type definitions *
* and processors. *
***********************************************************************
* DEPLOY FOR TEST (D4T) MAPPING *
***********************************************************************
* ATST (DEV)
$ESYMBOL SYMNAME=#ATSTD4T, X
SYMDATA='Y'
$ESYMBOL SYMNAME=#ATSTLDB, X
SYMDATA='Your.Team.DEV.ATST.LOADLIB'
$ESYMBOL SYMNAME=#ATSTLDC, X
SYMDATA='Your.Team.DEV.ATST.CICSLOAD'
$ESYMBOL SYMNAME=#ATSTLST, X
SYMDATA='Your.Team.DEV.ATST.LISTLIB'
$ESYMBOL SYMNAME=#ATSTDBR, X
SYMDATA='Your.Team.DEV.ATST.DBRM'
* BTST (DEV)
$ESYMBOL SYMNAME=#BTSTD4T, X
SYMDATA='Y'
$ESYMBOL SYMNAME=#BTSTLDB, X
SYMDATA='Your.Team.DEV.BTST.LOADLIB'
$ESYMBOL SYMNAME=#BTSTLDC, X
SYMDATA='Your.Team.DEV.BTST.CICSLOAD'
$ESYMBOL SYMNAME=#BTSTLST, X
SYMDATA='Your.Team.DEV.BTST.LISTLIB'
$ESYMBOL SYMNAME=#BTSTDBR, X
SYMDATA='Your.Team.DEV.BTST.DBRM'
* CTST (DEV)
$ESYMBOL SYMNAME=#CTSTD4T, X
SYMDATA='Y'
$ESYMBOL SYMNAME=#CTSTLDB, X
SYMDATA='Your.Team.DEV.CTST.LOADLIB'
$ESYMBOL SYMNAME=#CTSTLDC, X
SYMDATA='Your.Team.DEV.CTST.CICSLOAD'
$ESYMBOL SYMNAME=#CTSTLST, X
SYMDATA='Your.Team.DEV.CTST.LISTLIB'
$ESYMBOL SYMNAME=#CTSTDBR, X
SYMDATA='Your.Team.DEV.CTST.DBRM'
*
*
*
*Symbol Definition Examples: *
*
* Example DSN High Level Qualifier:
$ESYMBOL SYMNAME=#HLQ,SYMDATA='Your.Application.HLQ'
*
*
***********************************************************************
* LAST INVOCATION - END THE TABLE GENERATION
*---------------------------------------------------------------------*
$ESYMBOL CALL=END
END
Loading