Alex Bruzzone
New User
Joined: 18 Aug 2010 Posts: 4 Location: Ottawa
|
|
|
|
I've used TSO/ISPF file-tailoring services but I've always found it difficult to setup and use. Anyone else finds File-Tailoring Services complex to setup and use?
I needed to use this service in order to generate JCL and COBOL programs. So I developed something simpler that allows me to generate all kinds of JCL and COBOL programs.
My utility is a Batch-only system which I prefer because the results show up in my IOF and no setup is required. I'm not very fond of software with endless useless panels, such as PLATINUM.
My Skeletons have only 3 simple Directives: #VAR, #START/#END REPEAT, and #START/#END CASE. Data is passed to the Skeletons from a program in "sparse arrays" which are implicitly defined in the Skeletons. If necessary, a program can query a particular Skeleton's structure and #VARS.
#VARS names are 4 characters long and have "dimensions" from 0 up, depending on their location in the skeleton: #VARs inside a Repeat-Block increase in di8mension. Repeat-Blocks can be defined inside Repeat-Blocks.
In the example below you can see how the Directives are coded. A "*" in Col1 are Skeleton Comments. Obviously, at firts glance a Skeleton looks "scary":
Code: |
//TEST PGM=FTAIL
!DATA
DATE{}="NOV 29, 2010"
NUMB{1}="01"
NUMB{2}="02"
NUMB{3}="03"
NUMB{4}="04"
//*
//SKEL DD DATA
!SKELETON SAMPLE
#VAR DATE (Date passed by program)
//* DATE: {DATE
#START REPEAT
#VAR NUMB (SORT WORKAREA NUMBER)
//DSNUPROC.SORTWK{NUMB DD DSN=&&SORTWK{NUMB,
// DISP=(,PASS,DELETE),
*
* CASE
*
#START CASE
#WHEN NUMB="02"
// SPACE=(16384,(200,800),RLSE),
#WHEN ELSE
// SPACE=(16384,(800,800),RLSE),
#END CASE
*
* END CASE
*
// UNIT=SYSDA
//*
#END REPEAT
/* |
Result:
Code: |
//* DATE: NOV 29, 2010
//DSNUPROC.SORTWK01 DD DSN=&&SORTWK01,
// DISP=(,PASS,DELETE),
// SPACE=(16384,(800,800),RLSE),
// UNIT=SYSDA
//*
//DSNUPROC.SORTWK02 DD DSN=&&SORTWK02,
// DISP=(,PASS,DELETE),
// SPACE=(16384,(200,800),RLSE), <== notice the CASE
// UNIT=SYSDA
//*
//DSNUPROC.SORTWK03 DD DSN=&&SORTWK03,
// DISP=(,PASS,DELETE),
// SPACE=(16384,(800,800),RLSE),
// UNIT=SYSDA
//*
//DSNUPROC.SORTWK04 DD DSN=&&SORTWK04,
// DISP=(,PASS,DELETE),
// SPACE=(16384,(800,800),RLSE),
// UNIT=SYSDA
//* |
As you can see, the number of iterations will be determined by the values of the variables passed by the program.
I've implemented a number of Utilities using MY File-Tailoring system: COBOL programs to access DB2, JCL, Documentation. My latest utility generates ALL the precise JCL to move data from one DB2 database to another using DSN1COPY. This is a very comprehensive utility because it also generates the JCL to Unload data and Reload it in the Target DB in case DSN1COPY is unable to perform the task in certain cases.
I will write about my DSN1COPY JCL generator in the appropriate Forum.
Alex Bruzzone
DBA
Canada Revenue Agency |
|