Previous Topic: SyntaxNext Topic: PRINTLOG


Keywords

Following is a list of the valid keywords for the PRINT command. For detailed information regarding these keywords, see Keywords.

PRINT Examples

Example 1

This example demonstrates the formatting capabilities of the PRINT command and its keywords. In the following report, the data is formatted using a COBOL copybook and then printed. Each field definition is printed separately.

PRINT,
  FORMAT(SINGLE),
  LAYOUTFILE(CUSTOMER.COPYLIB(COPYBOOK))

Print Report DSN = CUSTOMER.KSDS.V Key = 1 Key len = 20 Rec #1 Record Length = 80 Pos *-----------FIELD NAME--------------* FORMAT *---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8 1 01 COMPANY-DATA 80 1 03 COMPANY-NAME C 20 Acme Widgets 21 03 COMPANY-ADDRESS C 30 974 EZ Street 51 03 COMPANY-CITY C 10 Miami 61 03 COMPANY-STATE-CODE C 2 FL 63 03 FILLER C 18 Rec #2 Record Length = 80 Pos *-----------FIELD NAME--------------* FORMAT *---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8 1 01 COMPANY-DATA 80 1 03 COMPANY-NAME C 20 Best Widgets 21 03 COMPANY-ADDRESS C 30 2424 Highland Dr. 51 03 COMPANY-CITY C 10 Boise 61 03 COMPANY-STATE-CODE C 2 ID 63 03 FILLER C 18 Rec #3 Record Length = 80 Pos *-----------FIELD NAME--------------* FORMAT *---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8 1 01 COMPANY-DATA 80 1 03 COMPANY-NAME C 20 CT Widgets 21 03 COMPANY-ADDRESS C 30 8021 Hartford Blvd 51 03 COMPANY-CITY C 10 Farmington 61 03 COMPANY-STATE-CODE C 2 CT 63 03 FILLER C 18

Example 2

Using an H with the FORMAT keyword, the data is printed in hexadecimal format as shown in the following sample report.

PRINT,
  FORMAT(HEX)

Print Report DSN = CUSTOMER.KSDS.V Key pos = 1 Key len = 20 Print Record Length = 80 Key=Acme Widgets C8984E8888AA44444444 13450694753200000000 Rec #1 pos ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0 1 Acme Widgets 974 EZ Street Miami FL C8984E8888AA44444444FFF4CE4EA988A44444444444444444D889844444CD444444444444444444 13450694753200000000974059023955300000000000000000491490000063000000000000000000 Print Record Length = 80 Key=Best Widgets C8AA4E8888AA44444444 25230694753200000000 Rec #2 pos ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0 1 Best Widgets 2424 Highland Dr. Boise ID C8AA4E8888AA44444444FFFF4C88898984C944444444444444C98A844444CC444444444444444444 252306947532000000002424089783154049B0000000000000269250000094000000000000000000 Print Record Length = 80 Key=CT Widgets CE4E8888AA4444444444 33069475320000000000 Rec #3 pos ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0 1 CT Widgets 8021 Hartford Blvd FarmingtonCT CE4E8888AA4444444444FFFF4C89A89984C9A8444444444444C899898A99CE444444444444444444 33069475320000000000802108193669402354000000000000619495736533000000000000000000

Example 3

Using a C with the FORMAT keyword, the data is printed in character format, as shown in the following sample report.

PRINT,
  FORMAT(CHARACTER)

Print Report DSN = CUSTOMER.KSDS.V Key pos = 1 Key len = 20 Print Record Length = 80 Key=Acme Widgets Rec #1 pos ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0 1 Acme Widgets 974 EZ Street Miami FL Print Record Length = 80 Key=Best Widgets Rec #2 pos ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0 1 Best Widgets 2424 Highland Dr. Boise ID Print Record Length = 80 Key=CT Widgets Rec #3 pos ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0 1 CT Widgets 8021 Hartford Blvd FarmingtonCT