Enyalius
Enyalius

Reputation: 309

How can I use IEBGENER?

I am having some trouble figuring out how to get IEBGENER working in the way that I want it to. I should preface all this by saying that I am running IEBGENER in a z/OS environment on an academic mainframe.

I have three JCL procedures (PROC) inline to some COBOL code that I am working with, and I need IEBGENER as one of the first steps to put my PROC into a "permanent procedure library under my MVS ID" as well as put my COBOL source "into a permanent sequential data set under my MVS ID".

The instructor mentions to "remember to code the correct LRECL and BLKSIZE information for these data sets."

I am not very familiar with IEBGENER and haven't found anything that really explains to me how to do what I am trying to do.

Any "Big Iron" people able to help?

Upvotes: 3

Views: 6345

Answers (7)

wolfen244
wolfen244

Reputation: 11

IEBGENER is one of the most underrated and misunderstood utilities IBM has.

Here is the hyperlink for the best documentation: IEBGENER.

IEBGENER is not merely a file-to-file utility that only does copies. It can easily and more efficiently create variable blocked files. It can with the proper buffering actually be your fastest file-to-file copy utility as it used to not be internally buffered very well though now I believe it is so it is now automatically just about the fastest. The //SYSPRINT messages - sadly - are extremely cryptic if not actually annoyingly ridiculous. Many shops have an accelerator called BETERGENER as most programmers had no idea how to buffer IEBGENER and since IBM is catering to the pampered new programmers who want MVS to look like and act like Windows, using IEBGENER is more user friendly. yuck

Upvotes: 0

Abacus
Abacus

Reputation: 2119

Just so you don't need to worry about the DCB parameter, it's nice trick to point to the value from the input dataset.

//STEP100  EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1   DD DISP=SHR,DSN=INPUT.FILE
//SYSUT2   DD DSN=OUTPUT.FILE,
//           DISP=(,CATLG,DELETE),
//           SPACE=(TRK,(300,50),RLSE),
//           DCB=*.SYSUT1
//SYSIN    DD DUMMY

Upvotes: 2

Mike Cee
Mike Cee

Reputation:

A couple of minor points:

DCB=(RECFM=FB,LRECL=80,DSORG=PO)

DCB= is not required anymore, just code

RECFM=FB,LRECL=80,DSORG=PO

Also:

Because the records are fixed-format, the BLKSIZE must be an even multiple of 80. Very often, people use a value of 3120. The reasons for this are hidden in the mists of antiquity. I tend to use 27920, to get the most efficient space usage on a 3390 device.

It should not be necessary to specify a blocksize for a new DASD (disc) dataset. System determined blocksize will automatically give you the best blocksize (which would indeed be 27920 for a LRECL of 80 on a 3390)

Upvotes: 2

Tony
Tony

Reputation: 1233

It sounds as if your instructor is reminding you to give the correct LRECL and BLKSIZE to the "permanent procedure library" and "permanent sequential data set". Historically, such data sets are RECFM=FB, LRECL=80.

Because the records are fixed-format, the BLKSIZE must be an even multiple of 80. Very often, people use a value of 3120. The reasons for this are hidden in the mists of antiquity. I tend to use 27920, to get the most efficient space usage on a 3390 device.

Upvotes: 0

kishore
kishore

Reputation: 407

Here is the link to IBM Z/OS manuals http://www-03.ibm.com/systems/z/os/zos/bkserv/v1r10books.html search for JCL and you will find the manuals for JCL. IEBGENER is a IBM supplied copy program to copy data from one dataset (file) to another dataset. You will have input file, output file and control file. LRECL and BLKSIZe are dataset parameters. If the input file and output file parameters do not match, data may not get copied correctly. I didn't understand your questions completely. Can you elaborate on what exactly you need to do with IEBGENER.

Upvotes: 2

user90784
user90784

Reputation:

As mentioned, IEBGENER is a copy program. It takes an input on SYSUT1 and "generates" it to output dataset SYSUT2. In your instance, since you are copying 2 files, its easiest to have 2 GENER steps, each one producing one output dataset.

The only tricky part here is to get the output datasets in the right format. So, to gener into the proclib, assuming that it is not currently cataloged, your SYSUT2 would look something like this:

//SYSUT2  DD  DSN=&SYSUID.PROCLIB,
//            DISP=(NEW,CATLG,DELETE),
//            DCB=(RECFM=FB,LRECL=80,DSORG=PO)

The sequential dataset for the source output would look similar, but no DSORG subparameter on the DCB option. The option of PO there says to create a PDS as opposed to a QSAM file. On modern z/OS installations, BLKSIZE is not necessary to code, as the system will calculate the optimum size if you don't specify it.

Upvotes: 5

Albert Visser
Albert Visser

Reputation: 1134

this is how to use IEBGENER (as mentioned, should be on the IBM docs site):

//COPY EXEC PGM=IEBGENER
//SYSUT1 DD DSN=MY.INPUT.FILE,DISP=SHR
//SYSUT2 DD DSN=MY.OUTPUT.FILE,DISP=NEW,SPACE=....
//SYSIN DD DUMMY

IEBGENER is "just a" copy program and about all it takes is an input file, output file, and a control file

I'm not sure what you think is "specific", isn't it just a matter of knowing which names to use?

edit: if what you want is defining your input inline, try this:

//SYSUT1 DD *
...
/*

or better yet, if your input contains JCL as well:

//SYSUT1 DD DATA,DELIMITER=XX
...
XX

Still not exceptional JCL, though.

Upvotes: 4

Related Questions