3

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?

MikeT
  • 51,415
  • 16
  • 49
  • 68
Enyalius
  • 309
  • 3
  • 10
  • I can advise you to have a look at the IBM documentation. They must be available in digital form. – Toon Krijthe Apr 14 '09 at 12:59
  • I appreciate your suggestion, but what I am trying to do is a bit specific and I really haven't found anything that shows me how to do what I want to do. – Enyalius Apr 14 '09 at 13:03
  • OMG, where do they teach this? When people say COBOL, I noticed their faces twinge and teeth screech. Good luck with your homework! – Peter Perháč Apr 29 '09 at 20:29
  • @MasterPeter: This stuff is still very widely used. If they don't teach it, they should. You would be surprised at the extent of mainframe technology and how deeply embedded it is in, especially, large corporations. – Taptronic May 14 '09 at 14:27
  • Yeah, they really don't teach it at enough schools. Mine was one of three universities, as of a few years ago, that taught things like COBOL, Assembly, etc. – Enyalius Jul 29 '10 at 17:55

7 Answers7

5

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.

4

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.

Albert Visser
  • 1,124
  • 6
  • 5
  • We are supposed to run IEBGENER from within the source file as a step; the same file that also has the source COBOL and the PROC steps. What was throwing me is that, in that case, I do not have an input file. Also, aren't the SYSUT1-2 use for I/O (not SYSIN/OUT)? – Enyalius Apr 14 '09 at 15:35
  • My bad, I should have noticed the double sysin – Albert Visser Apr 14 '09 at 18:37
2

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
Abacus
  • 2,041
  • 1
  • 18
  • 23
2

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)

2

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.

kishore
  • 407
  • 3
  • 10
0

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

wolfen244
  • 1
  • 1
0

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.

Tony
  • 1,221
  • 2
  • 12
  • 25
  • For the last 25 or so...there has been no need to use anything but BLKSIZE=0 for DASD. People keep putting card sequence numbers in their all uppercase source datasets too... – Joe Zitzelberger Dec 01 '11 at 06:27
  • Yup, that's true. I inferred that the instructor wanted a multiple of 80. I might be wrong about that. – Tony Nov 01 '13 at 21:17