Showing posts with label IEBPTPCH. Show all posts
Showing posts with label IEBPTPCH. Show all posts

Sunday, 4 August 2013

IEBPTPCH PRINT Statement: JCL and Parameter Examples

PRINT TYPORG=PS,STOPAFT=100 tells IEBPTPCH to print the first 100 logical records from a sequential data set. The utility can also print an entire PDS or PDSE, selected members, selected records, hexadecimal output, packed-decimal conversions, or a listing with page titles.

IEBPTPCH PRINT flow showing SYSUT1 input, SYSIN controls, SYSUT2 output, and SYSPRINT messages
SYSUT1 supplies the records, SYSIN controls printing, SYSUT2 receives output, and SYSPRINT records messages.

What the IEBPTPCH PRINT statement handles

IEBPTPCH is a DFSMSdfp utility for printing or punching all or selected portions of a non-VSAM sequential data set, partitioned data set, or PDSE. “Print” does not require a physical printer: SYSUT2 can point to SYSOUT, disk, or tape.

This page focuses on the PRINT function and its common JCL parameters. Use the broader IEBPTPCH overview for default output-format details, PUNCH processing, and advanced editing.

Required IEBPTPCH DD statements

StatementPurpose
EXEC PGM=IEBPTPCHRuns the print-punch utility.
SYSPRINT DDReceives utility messages and diagnostics; required for each run.
SYSUT1 DDDefines the sequential, PDS, or PDSE input.
SYSUT2 DDDefines the formatted print output, commonly a SYSOUT class.
SYSIN DDContains the PRINT statement and optional TITLE, EXITS, MEMBER, and RECORD statements.

The JCL DD statement guide explains data-set references, SYSOUT, and disposition processing.

Print a sequential data set

//PRTSEQ   EXEC PGM=IEBPTPCH
//SYSPRINT DD  SYSOUT=*
//SYSUT1   DD  DSN=APP.CUSTOMER.MASTER,DISP=SHR
//SYSUT2   DD  SYSOUT=*
//SYSIN    DD  *
  PRINT TYPORG=PS
/*

TYPORG=PS selects sequential input and is the default. Keeping it explicit can make production JCL easier to review. IEBPTPCH formats each input record for the output data set rather than copying the original record unchanged.

Print a limited record range

//PRTLIM   EXEC PGM=IEBPTPCH
//SYSPRINT DD  SYSOUT=*
//SYSUT1   DD  DSN=APP.TRANSACTION.FILE,DISP=SHR
//SYSUT2   DD  SYSOUT=*
//SYSIN    DD  *
  PRINT TYPORG=PS,STRTAFT=500,STOPAFT=100,MAXLINE=60
/*

STRTAFT=500 skips 500 logical records before printing begins. STOPAFT=100 then prints 100 logical records. IBM limits both values to 32767. For VS or VBS records longer than 32 KB, IBM documents block-oriented counting exceptions.

Count carefully: STOPAFT is the number printed after the skipped input, not the final input-record number. The example prints records 501 through 600 for ordinary sequential input.

Sample every nth record with SKIP

//SYSIN DD *
  PRINT TYPORG=PS,SKIP=10,STOPAFT=25
/*

SKIP=10 selects every tenth record. STOPAFT=25 limits the number of selected records printed. This is useful for a quick sample, but it is not a data-validation method because most input records are deliberately omitted.

Print selected PDS or PDSE members

//PRTMEM   EXEC PGM=IEBPTPCH
//SYSPRINT DD  SYSOUT=*
//SYSUT1   DD  DSN=APP.JCLLIB,DISP=SHR
//SYSUT2   DD  SYSOUT=*
//SYSIN    DD  *
  PRINT TYPORG=PO,MAXNAME=2,STOPAFT=200
  MEMBER NAME=DAILY01
  MEMBER NAME=MONTHEND
/*

TYPORG=PO identifies partitioned input. If a MEMBER statement is present, MAXNAME must be at least the number of member names and aliases that follow. Without MEMBER statements, IEBPTPCH processes all members under the selected function and format.

Use IEBCOPY when the requirement is to copy, merge, load, or unload PDS/PDSE members rather than print their contents.

Add a title and control page length

//SYSIN DD *
  PRINT TYPORG=PS,INITPG=1,MAXLINE=55
  TITLE ITEM=('CUSTOMER MASTER AUDIT',10)
/*

The first TITLE statement supplies a title and an optional second TITLE supplies a subtitle. For printed output, titles appear on each page. A title literal can contain up to 40 bytes; the optional location controls its starting output position.

INITPG sets the first page number and MAXLINE sets the maximum printed lines per page. IBM documents 60 as the default for MAXLINE. These two parameters apply to PRINT, not PUNCH.

Convert records to hexadecimal or expanded decimal

//SYSIN DD *
  PRINT TYPORG=PS,TOTCONV=XE,STOPAFT=20
/*

TOTCONV=XE converts the entire record to a two-character-per-byte hexadecimal representation. It is useful when blanks, packed fields, or nonprinting bytes make the character listing ambiguous.

TOTCONV=PZ expands packed-decimal data into decimal display characters, but IEBPTPCH does not validate whether every byte is actually packed decimal. Do not apply PZ blindly to a mixed-format record. Use RECORD and FIELD editing when only selected positions require conversion.

Use PREFORM only for preformatted input

PREFORM=A tells IEBPTPCH that the first byte contains an ASA control character. PREFORM=M identifies a machine-code control character. This is appropriate for output already formatted for printing, such as certain stored dump data sets.

PREFORM changes control processing. IBM states that when it is coded, most other PRINT or PUNCH operands and control statements are ignored, although they can still be syntax checked. Do not combine PREFORM with ordinary formatting options and expect both behaviors.

PRINT statement parameter reference

ParameterUse
TYPORG=PS|POSelects sequential or partitioned input; PS is the default.
STRTAFT=nSkips records before processing starts.
STOPAFT=nLimits the number of records printed.
SKIP=nPrints every nth record.
TOTCONV=XE|PZConverts the entire record to hexadecimal or expanded decimal output.
CNTRL=1|2|3Selects single, double, or triple spacing for PRINT.
MAXNAME=nDeclares capacity for subsequent MEMBER names and aliases.
MAXFLDS=nDeclares capacity for FIELD parameters in later RECORD statements.
INITPG=nSets the initial page number.
MAXLINE=nSets the maximum lines per printed page.
DBCS=YES|NOControls double-byte character-set processing; NO is the default.

Control-statement order

PRINT or PUNCH must be the first utility control statement, and both cannot be used in one control data set. When used, TITLE follows the function statement; EXITS follows TITLE or the function statement; MEMBER and RECORD statements follow in the required processing order.

Keep utility control statements separate from JCL. They belong after SYSIN DD * or in the SYSIN data set. The JCL tutorial shows how JOB, EXEC, DD, and in-stream data work together.

Common IEBPTPCH failures

  • Omitting one of the required DD statements.
  • Using TYPORG=PS for a PDS or PDSE.
  • Coding MEMBER statements without a sufficient MAXNAME.
  • Assuming STOPAFT means the absolute ending input-record number.
  • Applying TOTCONV=PZ to fields that are not packed decimal.
  • Combining PREFORM with options that it causes the utility to ignore.
  • Sending a long listing to the wrong SYSOUT class.
  • Expecting IEBPTPCH to process VSAM input.

Check SYSPRINT first when the step returns a nonzero code. It contains the utility messages and echoed control information needed to locate DD-name and syntax problems.

Choose the right utility

  • Use IEBPTPCH to print or punch sequential/PDS/PDSE records.
  • Use IEBGENER to copy sequential records or create PDS/PDSE members from sequential input.
  • Use IEBCOPY for PDS/PDSE copy and maintenance operations.
  • Use IEHLIST to list directory, catalog, or VTOC information in its supported cases.

The mainframe utilities guide maps other common data-management jobs to the appropriate program.

Official IBM references

IEBPTPCH PRINT statement FAQ

What does the IEBPTPCH PRINT statement do?

It tells IEBPTPCH to format and write all or selected records from a sequential data set, PDS, or PDSE to the SYSUT2 output data set. SYSUT2 can be SYSOUT, disk, or tape.

How do I print only the first 100 records with IEBPTPCH?

Code PRINT TYPORG=PS,STOPAFT=100 in SYSIN. STOPAFT limits the number of logical records printed for ordinary sequential input.

How do I print selected PDS members with IEBPTPCH?

Use TYPORG=PO, set MAXNAME to at least the number of names that follow, and code one MEMBER NAME=member statement for each selected member.

Can I code PRINT and PUNCH in the same IEBPTPCH step?

No. IBM requires PRINT or PUNCH as the first utility control statement, and only one of those functions can be used in a control data set.

For a bounded production listing, start with PRINT TYPORG=PS,STRTAFT=n,STOPAFT=n and verify the selected SYSOUT class before submitting the job.

Sunday, 28 July 2013

All You Need To Know About JCL Utility, IDCAMS, IEBCOMPR, IEBCOPY, IEBDG etc.

Welcome Back once again Guys! 

In today's tutorial, You’ll learn how to use the z\OS JCL utility programs that make it easy for you to work with data sets and to generate test data. I will precisely introduce you to various JCL utility and important system libraries. So, let's start with the tutorial. 

JCL Utility
IBM Utility.

What is a Utility Program?

Technically speaking, JCL Utility programs (or just utilities) are the programs that can be used for common data processing functions like copying or printing a data set. With OS/390, you get an older set of utilities known as the MVS utilities.

The MVS utilities are older utilities that are provided by OS/390. Some of these utilities have been replaced by newer utilities or ISPF options. 

The JCL for running a utility program has to provide a DD statement for each ddname that’s used by the utility. The SYSIN data set is normally an in-stream data set that consists of control statements that provide processing specifications. 


All JCL utilities are normally run as batch jobs. z/OS provide a wide variety of function, but only a small number system provided JCL utility exist. Most of you might be aware of the utility IEFBR14, IEBGENER, and IEBCOPY. For VSAM you would normally use IDCAMS for various operations.

There are large utilities created by 3rd party vendors and are widely available on z/OS. The utilities are broadly categorized into two categories:

Data set utilities: These utilities are used for reorganizing data, compare data in two datasets, etc. All these utility run in batch mode.


System Utilities: These utilities are used to perform a wide-ranging operation that is related to data sets and volumes, such as data set names, catalog entries, and volume labels


IBM Utility
Example 
IDCAMS
IEBCOMPR
IEBCOPY
IEBDG
IEBEDIT
IEBGENER
IEBIMAGE
IEBISAM
IEBPTPCH
IEBTCRIN
IEBUPDAT
IEBUPDTE
IEFBR14
ICKDSF
IEHATLAS
IEHDASDR
IEHINITT
IEHIOSUP
IEHLIST
IEHMOVE
IEHPROGM
IFHSTATR



What are system libraries?


z/OS has many standard system libraries. A brief description of several libraries is appropriate here. The traditional libraries include: 
  • SYS1.PROCLIB - This is a system library that contains JCL procedures supplied with z/OS. 
  • SYS1.PARMLIB - This system library holds control parameters for z/OS supplied program and various other products. 
  • SYS1.LINKLIB - This library contains many of the basic execution modules of the system. In practice, it is one of a large number of execution libraries that are concatenated.
  • SYS1.LPALIB - This system library holds system execution modules that are loaded into the link  pack area when the system is initialized. 
  • SYS1.NUCLEUS - This system library holds the basic "kernel" modules of z/OS.
  • SYS1.SVCLIB. This library holds operating system routines known as supervisor calls (SVCs).

These libraries are in standard PDS format and are found on the system disk volumes.

#COBOL #JCL  #CICS #DB2

New In-feed ads