MVS38J

BSPHRCMD in MVS38J

Overview

BSPHRCMD version 1.0.2, an assembler utility from Volker Bandke, is used to issue Hercules console commands from MVS 3.8J via the DIAG 8 interface. Based on my knowledge, this utility program is included in MVS 3.8J TK3UPD and MVS 3.8J TK4- (from Juergen Winkelmann) systems.

My current system was installed using the original MVS Tur(n)key System TK3 CD-ROM and did NOT include BSPHRCMD… Before any TK3UPD updates!

However, overtime, I have applied user modifications from TK3UPD releases and others. Currently, I am using HERCMDC by Philippe Leite (CBT File #589) to issue Hercules console commands from MVS 3.8J.

Recently, I installed BSPHRCMD, simply, to be compatible with other common utilities present in most MVS 3.8J hobbyist installations.

During the transition to BSPHRCMD, I noticed a printing anomaly with the command processing report generated on DD SYSPRINT. Referring to the below report snippet, the heading is printed correctly on a new page.

However, the command processing report is printed on a separate page with overlapping process lines (2 messages)! See the report snippet below:

The above reports are piped into a PDF capture process from Hercules after MVS spools the report to the emulated printer device. This rendering behavior may be incorrect! Therefore, let’s interrogate the RAW data generated from BSPHRCMD under MVS to SYSPRINT!

Before springing into a discussion on RAW data, we need a refresher on printer carriage control characters.

Carriage
Control         Printer 
Character       Action
----------------------------------------------------------------
   1       |    Advance to top of page before printing
   +       |    Do not advance  before printing
 Blank     |    Advance 1 line  before printing
   0       |    Advance 2 lines before printing
   -       |    Advance 3 lines before printing

The below RAW data capture contains 9 133-byte records truncated to 100 bytes for discussion purposes.

RAW data from SYSPRINT

       1---5----0----5---0----5---0----5---0----5---0----5---0----5---0----5---0----5---0----5---0----5---0----5---0
000001 1BSPHRCMD Version 1.0.2                                                                             
000002 0                                                                     l      _,,,---,,_             
000003                                                                ZZZzz /,:.-':'    -.  ;-;;,          
000004                                                                      ,4-  ) )-,_. ,( (  :'-'        
000005                                                                    '---''(_/--'  :-')_)             
000006 0                                                            Placed into the Hercules Domain        
000007                                                              by Volker Bandke, BSP GmbH             
000008 1BSPHC91I - Processing command: DEVLIST                                                             
000009 1BSPHC99I - End of processing, MAXRC=0000                                                           
       ^
       +
       +
       +------- Printer
                Control
                Character

Now, let’s take on the role of a 1403 printer and process the RAW data!

Record 1, contains a 1 in position 1 which advances the printer paper to top of page before printing content.

Record 2 contains a 0 in position 1 which advances the page 2 lines (double-space) before printing content.

Records 3-5 contain a space in position 1 which advances the page 1 line (single-space) before printing content.

Record 6 contains a 0 in position 1 which advances the page 2 lines (double-space) before printing content.

Record 7 contain a space in position 1 which advances the page 1 line (single-space) before printing content.

At this point, the title and page number header and logo are printed as page 1 consuming 9 physical lines of content.

Records 8 and 9 represent command process reporting.

Record 8 contains a 1 in position 1 which advances the printer paper to top of page before printing content.

Record 9 contains a 1 in position 1 which advances the printer paper to top of page before printing content.

At this point, 3 pages are printed!!!

Solution

My Assumption:
Create a process report page comprised of page header (BSPHRCMD title and page number) with logo followed by MSGTXT lines limited to 55 lines per page. On page overflow, augment page number, print page header, logo and current detail MSGTRXT line on a new page.

After a quick review of BSPHRCMD, a solution to my assumption, is to initialize the carriage control field (PRNTCC) with a space and augment the line counter (LINENUM) including a correction to initialize LINENUM in subroutine PUTMSG.

This results in MSGTEXT printing as single-spaced while accumulating print lines to facilitate page overflow detection.

See the below BSPHRCMD snippet for highlighted modifications.

         TITLE 'Subroutines: PUTMSG - Display an error message'         00610000
*********************************************************************** 00620000
* Routine to display an error message. The error message is assumed   * 00630000
* to be stored in the MSGTEXT area (and is at most 124 bytes long)    * 00640000
* The messages will be written to SYSPRINT DD if available and open.  * 00650000
* If not, the messages will be isssued via WTO                        * 00660000
*                                                                     * 00670000
* Registers on Entry: R14 = Return address                            * 00680000
*********************************************************************** 00690000
         SPACE 1                                                        00700000
PUTMSG   DS    0H                     , output message on sysprint/wto  00710000
         STM   R14,R3,PUTMSAVE        , save registers                  00720000
         IF    (TM,PROCFLAG,PRNTOPEN,O) SYSPRINT available?             00730000
          IF   (CP,LINENUM,GT,=PL2'55') end of page reached?            00740000
           MVC PRNTLINE,HEAD001       , Put in page header              00750000
           ZAP LINENUM,=P'09'         , reinit line number              00760000
           AP  PAGENUM,=P'1'          , increment page number           00770000
           MVC HEAD0011,=X'40202120'  , insert edit mask                00780000
           ED  HEAD0011,PAGENUM       , beautify page number            00790000
           PUT SYSPRINT,PRNTLINE      , write page header               00800000
           PUT SYSPRINT,HEAD0C1       , Insert LOGO1                    00810000
           PUT SYSPRINT,HEAD0C2       , Insert LOGO2                    00820000
           PUT SYSPRINT,HEAD0C3       , Insert LOGO3                    00830000
           PUT SYSPRINT,HEAD0C4       , Insert LOGO4                    00840000
           PUT SYSPRINT,HEAD0C5       , Insert LOGO5                    00850000
           PUT SYSPRINT,HEAD0C6       , Insert LOGO6                    00860000
          ENDIF                                                         00870000
          MVI   PRNTCC,C' '           , assume single spacing           ********
          BLANK PRNTTEXT              , erase any garbage               00880000
          MVC   PRNTTEXT(L'MSGTEXT),MSGTEXT                             00890000
          PUT   SYSPRINT,PRNTLINE                                       00900000
          AP    LINENUM,=P'1'         , increment line number           ********
         ELSE                         , no SYSPRINT, use WTO instead    00910000
          WTO  MF=(E,THEWTO)                                            00920000
         ENDIF                                                          00930000
         XR    R15,R15                , clear RC                        00940000
         ST    R15,PUTMSAVE+4         , set caller's RC                 00950000
         LM    R14,R3,PUTMSAVE        , restore return address          00960000
         BR    R14                    , and return                      00970000

After applying the suggested modification, the report prints correctly on one page!

The below RAW data validates the solution based on above assumption.

RAW data from SYSPRINT after modification to BSPHRCMD

       1---5----0----5---0----5---0----5---0----5---0----5---0----5---0----5---0----5---0----5---0----5---0----5---0
000001 1BSPHRCMD Version 1.0.2                                                                             
000002 0                                                                     l      _,,,---,,_             
000003                                                                ZZZzz /,:.-':'    -.  ;-;;,          
000004                                                                      ,4-  ) )-,_. ,( (  :'-'        
000005                                                                    '---''(_/--'  :-')_)             
000006 0                                                            Placed into the Hercules Domain        
000007                                                              by Volker Bandke, BSP GmbH             
000008  BSPHC91I - Processing command: DEVLIST                                                             
000009  BSPHC99I - End of processing, MAXRC=0000                                                           
       ^
       +
       +
       +------- Printer
                Control
                Character

Hope you find this post helpful….

Of course, your assumption may be different from mine which results in a different and valid solution.

Please use the comment box below or the contact us link on the menu bar to communicate suggestions, and/or improvements.

Have fun!

Larry Belmontes

Leave a Reply

Your email address will not be published. Required fields are marked *


CAPTCHA Image
Reload Image

This site uses Akismet to reduce spam. Learn how your comment data is processed.