USING SAS SOFTWARE TO COMPARE STRINGS OF VOLSERS IN A JCL JOB AND A TSO CLIST

Similar documents
Contents. About This Book...1

Performance Objectives

Merge Processing and Alternate Table Lookup Techniques Prepared by

Beginning Tutorials. PROC FSEDIT NEW=newfilename LIKE=oldfilename; Fig. 4 - Specifying a WHERE Clause in FSEDIT. Data Editing

Additional Operands Using Existing Datasets

Appendix B WORKSHOP. SYS-ED/ Computer Education Techniques, Inc.

Chapter 1 RUNNING A SIMPLE JOB. SYS-ED/ Computer Education Techniques, Inc.

MVS/QuickRef - Tailoring QW

A-LOG. User s Manual. Version 3.8

Santa Barbara, California March In the discussions that follow, byte means 8 bits, with those eight bits numbered 0-7 from left to right.

BASICS BEFORE STARTING SAS DATAWAREHOSING Concepts What is ETL ETL Concepts What is OLAP SAS. What is SAS History of SAS Modules available SAS

work.test temp.test sasuser.test test

IBM Education Assistance for z/os V2R1

INNOVATION TECHSUPPORT

Optimizing System Performance

Chapter 2: Getting Data Into SAS

Transporting files between MVS and MVS or between MVS and a Workstation

Accessing Data and Creating Data Structures. SAS Global Certification Webinar Series

Base and Advance SAS

16. Reading raw data in fixed fields. GIORGIO RUSSOLILLO - Cours de prépara)on à la cer)fica)on SAS «Base Programming» 364

CA Disk Backup and Restore CA RS 1609 Service List

z/os Learning Center: Introduction to ISPF Unit 1: The Basics of ISPF and Data Sets Module 3: ISPF Data Set Basics

PROC FORMAT: USE OF THE CNTLIN OPTION FOR EFFICIENT PROGRAMMING

* Parameter... 1:18. B Backward References... 5:8 Blocksize: Choosing... 3:19

Data Center Management Systems

PDSUPDTE. 4. When the length of STRING2 is less than that of STRING1, blanks are inserted after the next pool of two blanks following STRING1.

SAS Online Training: Course contents: Agenda:

JCL Syntax Running a Simple Job

Contents. Overview How SAS processes programs Compilation phase Execution phase Debugging a DATA step Testing your programs

.THE INFORMATION CENTER INTERFACE (TICI) SA SI INQ FSP FSCALC A A2 G P N M J

USING EXISTING DATASETS

JCL MOCK TEST JCL MOCK TEST III

DFSMS:Intermediate NaviQuest Streamlining SMS Work

IBM. DFSMS Using the Interactive Storage Management Facility. z/os. Version 2 Release 3 SC

IBM Fault Analyzer for z/os

OS Utilities. Here is a chart of action words and parameters and a list of rules for ten frequently used OS Utilities:

QUEST Procedure Reference

Lecture 1 Getting Started with SAS

IBM Education Assistance for z/os V2R1

Moving a Large SAS System Into an MVS Production Environment The Trials and Tribulations

INTRODUCTION TO SAS HOW SAS WORKS READING RAW DATA INTO SAS

Chapter 2 CODING. SYS-ED/ Computer Education Techniques, Inc.

JCL MOCK TEST JCL MOCK TEST IV

SAS/ACCESS 9.2. DATA Step Interface to CA-IDMS Reference. SAS Documentation

IBM. Program Directory for. IBM z Systems Development and Test Environment Tools. V Program Number 5725-G39 FMID HALMB00.

T6 Document Code Title Continued

FA TSCOPY Quick Start Guide. Quick Start Guide

The CA Disk FILES Data Set

Program Directory for IBM z Systems Development and Test Environment Tools

SAS/ACCESS 9.4 DATA Step Interface to CA-IDMS: Reference

Chapter 2 INTERNAL SORTS. SYS-ED/ Computer Education Techniques, Inc.

SAS-USAGE UNDER ROSCOE/ETSO M.H.H. Lange, Centraal Beheer

Introduction to the SAS/ACCESS Interface to IMS

Dino Explorer. MVS Data Collector for Mainframe Assessment

PASS4TEST. IT Certification Guaranteed, The Easy Way! We offer free update service for one year

masc-ato Automated Transaction Operator General Information *** VSE/MVS Version 4.1.0

IBM. Documentation. IBM Sterling Connect:Direct Process Language. Version 5.3

Paper SAS Programming Conventions Lois Levin, Independent Consultant, Bethesda, Maryland

So, Your Data are in Excel! Ed Heaton, Westat

Chapter 7 File Access. Chapter Table of Contents

COMPUTER EDUCATION TECHNIQUES, INC. (JCL ) SA:

Creating and Executing Stored Compiled DATA Step Programs

Industry Applications

States the problem Shows the control cards required to solve the problem States the logic of the solution.

Paper CC16. William E Benjamin Jr, Owl Computer Consultancy LLC, Phoenix, AZ

Chapter 13. Synchronizing secondary index databases with a DEDB with FPA

The Three I s of SAS Log Messages, IMPORTANT, INTERESTING, and IRRELEVANT William E Benjamin Jr, Owl Computer Consultancy, LLC, Phoenix AZ.

FSEDIT Procedure Windows

How SAS Thinks Neil Howard, Basking Ridge, NJ

Incrementing Year Fields in Flat Files to Test Year 2000 Compliance Brian Bouvier, Fireman's Fund Insurance Company, Novato, CA.

Functions and CALL Routines

CA PDSMAN PDS Library Management CA RS 1404 Service List

IBM InfoSphere Optim for z/os Version 7 Release 2. Batch Utilities

JCL Utilities. A Access Method Services... 4:8 Alternate Indexes and Paths... 4:5 AMS Commands... 4:8 anyname DD Statement... 9:5

IBM Tivoli Advanced Reporting for DFSMShsm. User s Guide. Version 1 Release 1 SC

Interactive Systems. NESUG '96 Proceedings ROUND PEGS INTO SQUARE HOLES: DATA WAREHOUSES FOR THE HARDWARE IMPAIRED

Getting Your Data into SAS The Basics. Math 3210 Dr. Zeng Department of Mathematics California State University, Bakersfield

Initializing and Configuring the SAS System

CA TPX Session Management

Using Dynamic Data Exchange

An Introduction to SAS/FSP Software Terry Fain, RAND, Santa Monica, California Cyndie Gareleck, RAND, Santa Monica, California

ISPF Users Boot Camp - Part 2 of 2

Innovative Performance Improvements Through Automated Flowcharts In SAS

IBM Tivoli OMEGAMON XE for Storage on z/os Version Tuning Guide SC

APPENDIX 4 Migrating from QMF to SAS/ ASSIST Software. Each of these steps can be executed independently.

JCL JOB CONTROL LANGUAGE

Installation Instructions for SAS 9.4 Installation Kit for FTP Format on z /OS

Beginning Tutorials. Introduction to SAS/FSP in Version 8 Terry Fain, RAND, Santa Monica, California Cyndie Gareleck, RAND, Santa Monica, California

CA JCLCheck Workload Automation CA RS 1407 Service List

MQSeries for OS/390 - Log extract program

CA Disk Backup and Restore CA RS 1602 Service List

Applications Development

Allocating External Files

File Management. Chapter 12

Eventus Example Series Using Non-CRSP Data in Eventus 7 1

SAS Programming Conventions Lois Levin, Independent Consultant

CA TLMS Tape Management CA RS 1404 Service List

SAS Data Libraries. Definition CHAPTER 26

//JOBNAME JOB //STEPNAME EXEC //DDNAME DD //* comment - upper or lower case /*...end of JCL stream

How to Incorporate Old SAS Data into a New DATA Step, or What is S-M-U?

Transcription:

USING SAS SOFTWARE TO COMPARE STRINGS OF VOLSERS IN A JCL JOB AND A TSO CLIST RANDALL M NICHOLS, Mississippi Dept of ITS, Jackson, MS ABSTRACT The TRANSLATE function of SAS can be used to strip out punctuation and other unwanted characters resulting in a string of words separated by blanks which can then be compared word by word. This process is generally considered a word processing function and at first might not seem relevant or appropriate to working with JCL, SYSLOGS, CLISTS, or other system related files and records. Nevertheless, these types of files and records can be visualized as a series of words rather than individual bytes. The third generation language model would be to do a byte by byte comparison, build tables, make comparisons, keep or reject, write the record. Although SAS can be used to do a byte by byte comparison, it also allows us to consider a different solution that in fact might be more intuitive and easy to code. INTRODUCTION On a weekly basis we run three JCL JOBS that consist of a series of FDR steps to dump disk packs to tape. The VOL parameter of this JCL contains a string of tape VOLSERS which are added to over time as the disk packs become more saturated with data and more tapes are needed for the dump. Sometimes re-running a particular step is necessary for the operators or the on-call person. To simplify this process a TSO CLIST was written that can be invoked to build and submit the JCL to back up one disk pack at a time. Different personnel maintain the FDR backup JCL and the TSO CLIST, so a process was needed to simplify keeping the FDR JCL and the CLIST in sync as VOLSERS were added and removed from the backup JCL JOBS. To do this manually was a time consuming and error prone process. THE SOLUTION A solution was to write a SAS program to read the FDR JCL and the TSO CLIST, find the string of VOLSERS in each, sort and match-merge the VOLSERS, then print a report of VOLSERS that appear in the FDR JCL but not in the CLIST. This report is used to update the CLIST so that the strings of VOLSERS in it match those in the FDR JCL. 1

SAS FEATURES USED TRANSLATE FUNCTION INDEX FUNCTION INPUT / $VARYING INFORMAT ASSIGNMENT STATEMENT PROC SORT MERGE INPUT @@ SUBSETTING IF FILE PUT INFILE OPERATING ENVIRONMENT MVS/ESA SAS V6.06 THE PROGRAM DATA; INFILE AUTO; X=INDEX(REC, SER=( ); IF X > 0 INPUT @X+5 VOLS $VARYING72. LENVAR / @3 BLANK $1. @4 VOL2 $69. / @3 BLK2 $1. @4 VOL3 $69.; IF BLANK NE AND BLK2 NE TRANSLATE(VOLS,, /,=,(,) ); ; IF BLANK EQ AND BLK2 NE THEN DO; TRANSLATE(VOLS,, /,=,(,) ); @80 REC2 $80.; IF BLK2 EQ AND BLANK EQ THEN DO; TRANSLATE(VOL2,, /,=,(,) ); REC3= TRANSLATE(VOL3,, /,=,(,) ); @80 REC2 $80. @160 REC3 $80.; DATA CLIST; INFILE CLIST; X=INDEX(REC, VOL ); IF X > 0; input @X+5 VOLS $VARYING72. LENVAR; TRANSLATE(VOLS,, /,= (,) ); FILE CLIST2; PUT @1 REC1; DATA VOL1; IN INPUT VOLSER $ @@; AUTO= AUTO ; PROC SORT; BY VOLSER; DATA VOL2; INFILE CLIST2; 2

INPUT VOLSER $ @@; This statement calculates the length of CLIST= CLIST ; the string of VOLSERS - maximum of 72 PROC SORT; minus the value of x + 5. Ser=( is five BY VOLSER; bytes. DATA MERGE; MERGE VOL1 VOL2; BY VOLSER; IF CLIST= ; PROC PRINT; ID VOLSER; INPUT @X+5 VOLS $VARYING72. LENVAR / @3 BLANK $1. @4 VOL2 $69. VAR CLIST AUTO; / @3 BLK2 $1. @4 VOL3 $69.; PROGRAM DETAILS INFILE AUTO Reads a concatenation of three PDS members as in: //auto dd dsn=pds(disk1),disp=shr // dd dsn=pds(disk2),disp=shr // dd dsn=pds(disk3),disp=shr This statement reads a record for a length of 72 which is the maximum length these records can be because the last eight bytes are line numbers (80-8). The @ holds this record for additional processing. X=INDEX(REC, SER=( ); IF X > 0 The INDEX function is used to find the strings that start with `ser=(. The VOLSERS will follow this JCL parameter. If x is greater than zero, then a string has been found and you want the following calculating to occur.. The $VARYINGw. INFORMAT reads variable-length fields of character data. The w specifies the maximum width of a character field for all the records in the raw file. It is used when the length of a character value differs from record to record. LENVAR is a length variable that was calculated previously and must be used in conjunction with the $varying INFORMAT. This variable contains the actual width of the character field in the current record. The / advances the pointer to the next input line. The BLANK variable is used to determine if more VOLSERS follow; the VOL2 variable is the possible VOLSER string. The next two lines of code are for the same purpose. This would normally take care of the possible VOLSER strings, but if not another series of these lines can be added. IF BLANK NE AND BLK2 NE ; 3

IF BLANK EQ AND BLK2 NE @80 REC2 $80.; IF BLK2 EQ AND BLANK EQ TRANSLATE(VOL2,, /,=,(,) ); REC3= TRANSLATE(VOL3,, /,=,(,) ); @80 REC2 $80. @160 REC3 $80.; For an explanation of the previous lines of code, let s examine the following JCL statements: //TAPE1 DD DSN=B.DSK876, // UNIT=TAPE,DISP=(,CATLG), // VOL=(,,,9),SER=(DS8761, // DS8763,DS8764)) //SYSPRIN2 DD SYSOUT=* //DISK2 DD VOL=SER=DSK877 //TAPE2 DD DSN=B.DSK877, // UNIT=TAPE,DISP=(,CATLG), // VOL=(,,,25,SER=(DS8771, // DS8772,DS8773,DS8774, // DS8775,DS8776)) //SYSIN DD DSN=PDS1(FDROPT) After the initial VOLSER string is located using the INDEX function to determine where the character string ser=( begins, it is then necessary to know how many additional strings of VOLSERS follow. The BLANK and BLK2 variables are used for this check. If the third column of the next line is blank and the third column of the next line is not blank, then there is only one additional line. If the third column of both lines is blank then there two additional lines. Additional checks can be added for more strings of VOLSERS if needed. The TRANSLATE function is used to substitue a blank for the following characters: /, =( ). This in effect puts a space between each VOLSER making the record a string of words which allows the use of the INPUT @@ statement later. FILE and PUT statements are used to write these strings of volsers to a temporary data set. The DO statements have their respective END statements. DATA CLIST; INFILE CLIST; X=INDEX(REC, VOL ); IF X > 0; INPUT @X+5 VOLS $VARYING72. LENVAR; TRANSLATE(VOLS,, /,= (,) ); FILE CLIST2; PUT @1 REC1; 4

PROC SORT; BY VOLSER; To follow the preceding lines of code, we need to examine the following CLIST fragment: Else if &pack=dsk877 then do Set vol1=ds8771,ds8772,ds8773 Set vol2=ds8774,ds8775,ds8776 Set vol3=ds8777,ds8778,ds8779 Set vol4=ds877a,ds877b,ds877c Goto four End INFILE CLIST reads a TSO CLIST from a PDS as in: //clist dd dsn=clists(backup),disp=shr A record for a maximum of 72 characters is held for additional processing by using the trailing @. The INDEX function is used to find the string that starts with VOL. If this string is found, x will be a number greater than 0. A length is calculated and stored in variable LENVAR. The TRANSLATE function is used to strip out the following:, / = ( ); The record is then written a temporary file referenced by CLIST2. DATA VOL1; IN AUTO= AUTO ; INPUT VOLSER $ @@; PROC SORT; BY VOLSER; DATA VOL2; INFILE CLIST2; INPUT VOLSER $ @@; CLIST= CLIST ; The preceding two SAS DATA steps create SAS datasets which consists of the VOLSERS from the FDR jobs and the CLIST. ASSIGNMENT statements are used to create a field to indicate whether the VOLSERS came from the CLIST or the FDR JCL. Note the use of the INPUT statement with the @@. This is useful when each INPUT line contains values for several observations. DATA MERGE; MERGE VOL1 VOL2; BY VOLSER; IF CLIST= ; PROC PRINT; ID VOLSER; VAR CLIST AUTO; The MERGE DATA step does a merge by VOLSER of the two previous DATA steps. If the CLIST variable is blank or missing, then that indicates the VOLSER is in one of the FDR jobs but not in the CLIST. A report of the VOLSERS not in the CLIST are printed. If there are none, then there is no report. CONCLUSION Many times the data that programmers have to code for does not exist in neatly defined and delineated locations, but the flexibility and power of SAS allows one to find, compare and manipulate strings of data with relative ease and with a minimum amount of code. 5

DEFINITIONS CLIST - Command List. It is a high level interpretive language that enables one to work more efficiently with TSO. JCL - Job Control Language. It is a series of control statements that provide the means of communication between an application program and the operating system and computer hardware. JOB - A JOB is the basic independent unit of work. SYSLOG - System Log. This is a record of what has transpired on the system. TSO - Time Sharing Option. It allows users to interactively share computer time and resources. ACKNOWLEDGMENTS This author thanks Russell Ferguson, Deputy Director of Mississippi Dept of ITS for reading this paper and making suggestions. SAS@ is a registered trademark of SAS Industries INC. FDR@ is a registered trademark of Innovation Data Processing. Randall M Nichols 301 N Lamar St Suite 508 Jackson MS 39201 601-359-2642 nichols@its.state.ms.us 6