|
|
JCL
Scanner Post File Information from JCL to a File http://www.simotime.com |
| When technology complements business | Copyright © 1987-2010 SimoTime Enterprises All Rights Reserved |
This suite of programs will scan JCL members and extract file information based on the IDCAMS or DD statements. The file information will be written to a sequential file. This capability and the information it provides is quite useful when migrating a batch application and data from a Mainframe System to a Windows System using Micro Focus technologies.
The sequential file created by this suite of programs is in the format that is required to do a batch update to the File Properties Repository (a Micro Focus Key-Sequenced-Data-Set or Indexed File). For more information about how to do this refer to the File Properties and Repository Management document.
The source code, data sets and documentation are provided in a single zipped file called JCSCAN01.ZIP. This zipped file may be downloaded from the SimoTime Web site. This example illustrates the following functions.
| Item | Description |
| 1. | Create a list of Source Members (JCL, PROC's and/or Parameter Files) to be scanned. |
| 2. | Scan the Source Members and create a record sequential file of file properties extracted from DD statements and Delete/Define statements used by IDCAMS. |
| 3. | Scan the Source Members (JCL, PROC and PARMCARD) and create a record sequential file of application properties extracted from EXEC statements and "RUN PROG(programName) statements used in SYSTSIN by IKJEFT01. |
| 4. | Copy/Repro JCL members and change the use of the ++INCLUDE to the standard ZOS JCL INCLUDE with a JCLLIB Statement. |
This section describes the process for scanning JCL Members, PROC's and/or Parameter Control Cards to extract file information fron DD statements and the DEFINE statements of IDCAMS.
This job (JCSCANE1.CMD) is a three step job. The 1st step will do housekeeping to prepare the environment. The second step will delete any files left over from a previous run. The third step will create an ASCII/Text file containing a list of member names to be scanned.
C:\SimoSam1\ProdLibA>JCSCANE1
This job (JCSCANE2.CMD) is a three step job. The 1st step will do housekeeping to prepare the environment. The second step will delete any files left over from a previous run. The third step will scan the source members based on the list of member names and create a record sequential file containing information extracted from DD statements and DEFINE statements for IDCAMS.
C:\SimoSam1\ProdLibA>JCSCANE2
Once the File Information has been obtained from the JCL Scan the record sequential file is in a format that will feed the File Properties Repository Management System. Refer to the Catalog Population for Micro Focus and the File Properties Repository Management provided in separate documents.
The following COBOL copy file (FPLRECB1.CMD) shows the record layout for the record sequential (RSEQ) file that s used to do a batch update of the File Properties Repository.
*****************************************************************
* Copyright (C) 1987-2010 SimoTime Enterprises *
* All Rights Reserved *
*****************************************************************
* Provided by SimoTime Enterprises *
* Our e-mail address is: helpdesk@simotime.com *
* Also, visit our Web Site at http://www.simotime.com *
*****************************************************************
* Copy File for a List of Files.
01 FPRS0512-REC.
05 FPRS0512-DATA-01.
10 FPRS0512-BASE-INFO.
15 FPRS0512-LEVEL-NBR PIC 9(2).
15 FPRS0512-DSN-NAME PIC X(54).
15 FPRS0512-DD-NAME PIC X(17).
10 FPRS0512-FILE-PROPERTIES.
15 FPRS0512-DCB-DSORG PIC X(4).
15 FPRS0512-DCB-RECFM PIC X(4).
15 FPRS0512-MIN-LRECL PIC 9(5).
15 FPRS0512-MAX-LRECL PIC 9(5).
15 FPRS0512-KEY-POS PIC 9(5).
15 FPRS0512-KEY-LEN PIC 9(5).
15 FPRS0512-VSAM-DAT PIC X(44).
15 FPRS0512-VSAM-IDX PIC X(44).
10 FPRS0512-USER-INFO.
15 FPRS0512-JCL-OVR1 PIC X(8).
15 FPRS0512-JCL-USR1 PIC X(8).
15 FPRS0512-JCL-USR2 PIC X(8).
15 FPRS0512-CATEGORY-1 PIC 9(2).
15 FPRS0512-CATEGORY-2 PIC 9(3).
10 FPRS0512-JOB-INFO.
15 FPRS0512-JCL-MEMBER PIC X(12).
15 FPRS0512-JOB-NAME PIC X(17).
15 FPRS0512-STEP-NAME PIC X(17).
15 FPRS0512-EXEC-TYPE PIC X(4).
15 FPRS0512-EXEC-NAME PIC X(8).
10 FILLER PIC X(236).
* FPLRECB1 - End-of-Copy File...
This section provides technical detail about the supporting scripts and programs used or called by the primary jobs.
A command file (ezSetEnv.CMD located in the sub-directory named ProdLibA) is called from other command files to set commonly used environment variables. This provides a single point of definition. The following is a listing of the contents of the command file.
rem * *******************************************************************
rem * Set the commonly used environment variables. This is used to
rem * provide a single point for managing the commonly used environment
rem * variables.
rem *
set BaseLib1=c:\SimoSAM1
rem *
rem * The following two (2) statements are required when Hyperlinking from
rem * an Excel Spreadsheet.
c:
cd %BaseLib1%\ProdLibA
rem *
set SYSOUT=%BaseLib1%\LOGS\SYSOUT_USER.TXT
set SYSLOG=%BaseLib1%\LOGS\SYSLOG_USER.TXT
set SimoNOTE=%BaseLib1%\LOGS\SIMONOTE_USER.TXT
set DataLib1=%BaseLib1%\DataLibA
call SimoNOTE "*"
if "%1" == "" goto :NoHeader
call SimoNOTE "**********************************************ezSetEnv/%1"
:NoHeader
rem *
set LRSTOKEN=%DataLib1%\Txt1\LRSTOKEN.TXT
set CobCpy=%BaseLib1%\CobCpy1;c:\SimoLIBR
rem *
rem set MAINFRAME_FLOATING_POINT=true
rem *
rem * set MFTRACE_CONFIG=%BaseLib1%\LOGS\TRACE001\ctfrtsfs.cfg
rem * set MFTRACE_LOGS=%BaseLib1%\LOGS\TRACE001
rem *
rem * The following SORTSPACE of 1 gigabyte is used when sorting very
rem * large files. The value is the digit one (1) followed by nine (9)
rem * zeroes. To allocate this amount of memory for sorting requires a
rem * minimum of two (2) gigabytes of RAM.
rem set SORTSPACE=1000000000
rem *
rem * For large file support and record locking control of File Handler
set EXTFH=%BaseLib1%\SysLibA1\EXTFH4AE.CFG
rem * Set environment for MFBSI (Micro Focus Batch Scheduling Interface)
set ES_EMP_EXIT_1=mfbsiemx
set MFBSI_DIR=%BaseLib1%\BSIA\%ezServerName%
set MFBSIEOP_CMD=ENABLE
set MFBSIEOP_CSV=ENABLE
set MFBSIEOP_HTM=ENABLE
set MFBSIEOP_XML=ENABLE
rem *
rem * The following is used to map the location of files that are to be
rem * allocated using JCL with ES/MTO.
set ES_ALLOC_OVERRIDE=%BaseLib1%\SysLibA1\CatMapA1.cfg
rem *
rem * Set the environment for Core Dump on System error, CBLCORE file
rem set COBCONFIG_=%BaseLib1%\SysLibA1\Diagnose.CFG
set COBCONFIG_=
rem *
rem * The following may need to be adjusted based on individual systems
rem * and the various versions of the Operating System, Sub-Systems and
rem * other software.
if "%ezSetEnv%" == "Y" goto :NOPATH
set iexplore=C:\Program Files\Internet Explorer
set path="C:\Program Files\Micro Focus\Net Express 5.1\Base\";"C:\Program Files\Micro Focus\Net Express 5.1\Base\bin";%BaseLib1%\ProdLibA;%BaseLib1%\ProdLibA\UTIL;%PATH%;
rem set path="C:\Program Files\Micro Focus\Server 5.0\Base\";"C:\Program Files\Micro Focus\Server 5.0\Base\bin";%PATH%;
:NOPATH
set cobpath=%BaseLib1%\ProdLibA;%BaseLib1%\ProdLibA\UTIL;c:\SimoLIBR
set JobStatus=0000
set StepStatus=0000
set ezSetEnv=Y
call SimoNOTE "* BaseLib1 is %BaseLib1%"
The following (SimoNOTE.CMD) is a listing of the contents of the SimoNOTE.CMD command file.
@echo OFF rem * ******************************************************************* rem * This program is provided by: * rem * SimoTime Enterprises, LLC * rem * (C) Copyright 1987-2010 All Rights Reserved * rem * Web Site URL: http://www.simotime.com * rem * e-mail: helpdesk@simotime.com * rem * ******************************************************************* rem * rem * Text - Display message on screen and write to a log file. rem * Author - SimoTime Enterprises rem * rem * This script may be called from other scripts and expects a rem * single parameter enclosed in double quotes. The double quotes rem * will be removed. Before writing to the log file a date and time rem * stamp will be inserted in front of the message text. rem * rem * Note: The tilde (~) removes leading/trailing double-quotes. rem * if "%SimoNOTE%" == "" set SimoNOTE=c:\SimoLIBR\LOGS\SimoTime.LOG echo %date% %time% %~1>> %SimoNOTE% echo %~1
This section provides a technical overview of the Command Files (or scripts) and programs used by the JCL Scanning Application that extracts file properties from DD statements and DEFINE statements of IDCAMS.
This section will focus on the command files.
This job (JCSCANE1.CMD) is a multi-step job that will create an ASCII/Text file that contains a list of member names to be scanned.
@echo OFF
rem * ************************************************************************
rem * This procedure calls the following Windows Command Files.
rem * 1. ezSetEnv.CMD - this provides a single point for setting commonly
rem * used environment variables.
rem * 2. SimoNOTE.CMD - this provides a consistent process for displaying
rem * messages to the screen and writing to a journal or
rem * log file.
rem * ************************************************************************
rem ************
rem * SET * Set the Environment Variables
rem ********jcl*
rem *
rem ************
rem * if exist * Delete previously created Files
rem ********utl*
rem *
rem ************
rem * DIR * Create a JCL Member List
rem ********utl*
rem *
rem ************
rem * EOJ *
rem ************
rem *
rem * ************************************************************************
rem *
setlocal
call ezSetEnv
set CmdName=JCSCANE1
rem *
call SimoNOTE "*******************************************************************%CmdName%.CMD"
call SimoNOTE "Starting JobName %CmdName%.CMD"
call SimoNOTE "InfoNote Create a list of names for JCL or Parameter Cards"
rem *
rem * Step 1 of 03, Prepare the Environment
rem *
set JCSCANL1=%DataLib1%\DYN1\SIMOTIME.UTIL.JCSCANL1.TXT
set JCSCANL2=%DataLib1%\DYN1\SIMOTIME.UTIL.JCSCANL2.TXT
rem *
rem * Step 2 of 03, Delete previously created Files
if exist %JCSCANL1% erase %JCSCANL1%
if exist %JCSCANL2% erase %JCSCANL2%
rem *
rem * Step 3 of 03, Create the List of Member Names to be scanned.
rem * The DIR comand creates a list with filename.ext
rem * The FOR loop creates a member list with the
rem * fully qualified drive:\directory\filename.ext
rem *
dir /on /b /a-d %BaseLib1%\JCL\*.JCL>%JCSCANL1%
for /F %%i in (%JCSCANL1%) do echo %BaseLib1%\JCL\%%i>>%JCSCANL2%
rem *
if not "%ERRORLEVEL%" == "0" set JobStatus=0010
if not "%JobStatus%" == "0000" goto :EojNOK
:EojAOK
call SimoNOTE "DataMake %JCSCANL2%"
call SimoNOTE "Finished CmdName %CmdName%, Job Status is %JobStatus% "
goto :End
:EojNOK
call SimoNOTE "ABENDING CmdName %CmdName%, Job Status is %JobStatus% "
goto :End
:End
call SimoNOTE "FileInfo SYSOUT=%SYSOUT%"
call SimoNOTE "Finished JobName %CmdName%.CMD"
if not "%SimoGENS%" == "BATCH" pause
endlocal
This job (JCSCANE2.CMD) is a multi-step job that will scan source code based on a list of member names. The DD statements and DEFINE statements used by IDCAMS will be analyzed and the file properties will be written to a record in a sequential output file.
@echo OFF
rem * ************************************************************************
rem * This procedure calls the following Windows Command Files.
rem * 1. ezSetEnv.CMD - this provides a single point for setting commonly
rem * used environment variables.
rem * 2. SimoNOTE.CMD - this provides a consistent process for displaying
rem * messages to the screen and writing to a journal or
rem * log file.
rem * ************************************************************************
rem ************
rem * SET * Set the Environment Variables
rem ********jcl*
rem *
rem ************ ************
rem * JCSCANL2 *-----* JCSCANC1 *
rem *******lseq* ********cbl*
rem * *
rem **************** *****call******
rem * *
rem * ************ ************ ************
rem * * JCLLS080 *-----* JCSCANC2 *-----* FPRFFLD1 *
rem * *******lseq* ********cbl* *******rseq*
rem * *
rem * ************
rem * * SIMOPARS *
rem * ********cbl*
rem ******************
rem *
rem ************
rem * EOJ *
rem ************
rem *
rem * ************************************************************************
rem *
setlocal
call ezSetEnv
set CmdName=JCSCANE2
rem *
call SimoNOTE "*******************************************************************%CmdName%.CMD"
call SimoNOTE "Starting JobName %CmdName%.CMD"
rem *
rem * Step 1 of 03, Prepare the Environment
rem *
set JCSCANL2=%DataLib1%\DYN1\SIMOTIME.UTIL.JCSCANL2.TXT
set FPRFFLD1=%DataLib1%\DYN1\SIMOTIME.UTIL.FPRFFLD1.DAT
rem *
rem * Step 2 of 03, Define a New Output File
rem *
rem * The following copy statement will create a directory entry for
rem * a file with zero records, a null file. This is a necessary step
rem * because the program used in the following step will attempt to
rem * add records to an existing file.
rem *
if NOT exist %FPRFFLD1% copy nul %FPRFFLD1%
rem *
rem * Step 3 of 03, Append Records Containing File Properties
rem *
rem * Read the List-of-Member-Names file, scan the members and append
rem * the file information from the DD statements and the DEFINE
rem * statements for IDCAMS to the previously created output file.
rem *
call SimoNOTE "InfoNote Scan the JCL or Parm Cards for File Properties"
run JCSCANC1
if not "%ERRORLEVEL%" == "0" set JobStatus=0010
if not "%JobStatus%" == "0000" goto :EojNOK
:EojAOK
call SimoNOTE "DataMake %FPRFFLD1%"
call SimoNOTE "Finished CmdName %CmdName%, Job Status is %JobStatus% "
goto :End
:EojNOK
call SimoNOTE "ABENDING CmdName %CmdName%, Job Status is %JobStatus% "
goto :End
:End
call SimoNOTE "FileInfo SYSOUT=%SYSOUT%"
call SimoNOTE "Finished JobName %CmdName%.CMD"
if not "%SimoGENS%" == "BATCH" pause
endlocal
This section will focus on the COBOL programs.
This program will read the JCSCANL2 file that is a list of source members and/or parameter files (PARM CARDS) and for each record it will set an environment variable for the member name and then call JCSCANC2 to process (or scan) each member.
This program will read a source member, usually JCL, PROC or Parm Card, and produce an output containing data file properties from the DD and IDCAMS information.
The purpose of this suite of programs is to provide an example of how to scan JCL members and extract file information based on the content of the DD statements and IDCAMS specifications and to save this information in a separate file.
Permission to use, copy, modify and distribute this software for any non-commercial purpose and without fee is hereby granted, provided the SimoTime copyright notice appear on all copies of the software. The SimoTime name or Logo may not be used in any advertising or publicity pertaining to the use of the software.
SimoTime Enterprises makes no warranty or representations about the suitability of the software for any purpose. It is provided "AS IS" without any express or implied warranty, including the implied warranties of merchantability, fitness for a particular purpose and non-infringement. SimoTime Enterprises shall not be liable for any direct, indirect, special or consequential damages resulting from the loss of use, data or projects, whether in an action of contract or tort, arising out of or in connection with the use or performance of this software.
This technology is available as a controlled release. Please contact the helpdesk@simotime.com for more information.
Note: You must be attached to the Internet to download a Z-Pack or view the list.
Please view the complete list of SimoTime Z-Pack Examples at http://www.simotime.com/sim4dzip.htm .
To use the information collected by the JCL Scanner to populate a Micro Focus Catalog refer to the Catalog Population for Micro Focus provided in separate document.
To save information collected by the JCL Scanner in the File Properties Repository refer to the File Properties Repository Management provided in separate document.
Check out The JCL Connection for more mainframe JCL examples.
This document provides a quick summary of the File Status Key for VSAM data sets and QSAM files.
Check out The Application Properties Repository Management for collecting, saving and using information about the source members that are used to build an application.
To review all the information available on this site start at The SimoTime Home Page .
Check out The SimoTime Glossary for a list of terms and definitions used in the documents provided by SimoTime.
If you have any questions, suggestions or comments please call or send an e-mail to: helpdesk@simotime.com
Founded in 1987, SimoTime Enterprises is a privately owned company. We specialize in the creation and deployment of business applications using new or existing technologies and services. We have a team of individuals that understand the broad range of technologies being used in today's environments. This includes the smallest thin client using the Internet and the very large mainframe systems. There is more to making the Internet work for your company's business than just having a nice looking WEB site. It is about combining the latest technologies and existing technologies with practical business experience. It's about the business of doing business and looking good in the process. Quite often, to reach larger markets or provide a higher level of service to existing customers it requires the newer Internet technologies to work in a complementary manner with existing corporate mainframe systems. Whether you want to use the Internet to expand into new market segments or as a delivery vehicle for existing business functions simply give us a call or check the web site at http://www.simotime.com
| Return-to-Top |
| Copyright © 1987-2010 SimoTime Enterprises All Rights Reserved |
| When technology complements business |