Search This Blog

Wednesday, March 3, 2010

JCL and Procs Running on a Windows Server Near You!

Hey folks,

Sorry to be slow in posting anything on mainframe migrations that I promised. 

Seven weeks ago I was grabbed by the neck and tossed into shark infested waters on a pilot project for a large retailer.  They were looking into the idea of turning off their mainframe.  For some reason or another they didn't just plop down their checkbook and write out a check.  "Run our application on a Windows?  Prove it." they said. 

So after many fun days and nights of work we demonstrated their application running off the mainframe.  Nothing like reinventing an environment which took twenty years to setup in a handful of weeks.

Looking back, we spent almost all of our time building out the plumbing.  Getting three CICS regions stood up that matched the mainframe, building out their PDS, Loadlib and Joblib structures on the server, wiring in an ISC link back to the mainframe, setting up Ezasockets, etc., took most of the time.  The application elements (BMS, JCL, PROCs, COBOL, etc) came down with no changes.  And once we finished the wiring, those elements ran just fine after compilation and whatnot.

In the past, the approach would have been to convert the JCL to a VB Script.  But nowadays JCL can be run pretty much as is.  The biggest caveats are around third party tools such as FileAid, Easytrieve, and so on and so forth.  Alternate approaches to those elements may have to be put together before the jobs can run.  But the core elements can run just like they are.

For instance, consider the sample JCL below:

//JCLTEST JOB 'JCL TEST',CLASS=B,MSGCLASS=A

//*
//* DELETE EXISTING DATASETS
//*
//GETRID EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE MFIJCL.OUTFILE.DATA
SET MAXCC=0
//*
//* ALLOCATE AND WRITE RECORDS TO A DATASET FROM A USER PROGRAM
//*
//CREATE EXEC PGM=JCLCREAT
//OUTFILE DD DSN=MFIJCL.OUTFILE.DATA,DISP=(,CATLG),
// DCB=(LRECL=80,RECFM=FB,DSORG=PS),
// SPACE=(800,(10,10)),UNIT=SYSDA
//SYSOUT DD SYSOUT=A
//*

//* USE THE IEBGENER SYSTEM UTILITY TO COPY RECORDS INTO A TEMPORARY
//* DATASET AND PASS ON FOR USE BY SUBSEQUENT STEPS
//*
//GENER EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD *
Rec 1
Rec 2
Rec 3
Rec 4
Rec 5
//SYSUT2 DD DSN=&&JTEMP,DISP=(,PASS),
// DCB=(LRECL=80,RECFM=FB,DSORG=PS),
// SPACE=(800,(10,10)),UNIT=SYSDA
//*
//* READ RECORDS FROM THE TEMPORARY DATASET CREATED IN THE PREVIOUS
//* STEP
//*
//READ EXEC PGM=JCLREAD
//INFILE DD DSN=&JTEMP,DISP=(OLD,DELETE)
//SYSOUT DD SYSOUT=A
//

It runs just fine on a Windows or UNIX box using the Micro Focus tools.  And before you ask, yes GDG's and restart logic work too.  My sample just didn't have any in it and I didn't go looking for a better sample.  You'll have to use your imagination.

The hardest part for the project involved getting the customer's CICS user exits brought over and working.  I had to wire in ISC links back up to the mainframe CICS region to execute routines not included in the downloaded project components.  But I digress... *smile*

I was talking JCL and Procs.  I have yet to find JCL that runs on z/OS which won't work... Those things I have that don't work are the utilities or third party tools, not bone-stock JCL.  Does anyone have a specific question on migrating JCL that they are dying to ask?