IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Default attributes for undeclared SYSPRINT in PL/1


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Alan Playford

New User


Joined: 22 Aug 2012
Posts: 48
Location: UK

PostPosted: Wed Apr 11, 2018 5:18 pm
Reply with quote

Guys,
We have a PL/1 program (inherited, one of many) which issues a DISPLAY to put information to the SYSPRINT file.
In the JCL it is pre-allocated first as a PS-FB-121-6050 dataset.
This is then defined in the PL/1 run step and allocated to the SYSPRINT DD statement.
It is NOT DECLAREd in the program itself (this is apparently not a neccessity!)

Running the program appears to change this PS-FB-121-6050 dataset to a PS-VB-1028-6144 dataset.

The DISPLAYed data appears there happily.
However, for logistical reasons I can't go into, this is too large and we really want to use the PS-FB-121 (or thereabouts) pre-allocated values instead.

Does anybody know how to circumvent this, or where the defaults are stored when SYSPRINT is dynamically allocated or used by PL/1?

Program appears below:
Code:
 ABCPROG: PROC OPTIONS(MAIN);                                         
  /*** WITHOUT THE FILE DCL THE LRECL BECOMES 1028 TOO BIG        ***/ 
   DISPLAY('BEGIN');                                                   
   DCL TAB(100:199) BIT(1) ALIGNED;                                   
   DCL II FIXED     BIN(15) INIT(10);                                 
   DISPLAY('Storage:  '  || CSTG(TAB)                                 
                         || '  LBound:  '                             
                         || LBOUND(TAB, 1)                             
                         || '  HBound:  '                             
                         || HBOUND(TAB, 1)                             
                         || ' ');                                     
    DISPLAY(TAB(II*6+100) || TAB(II*6+101));                           
    TAB(II*6+100) = '1'B;                                             
    DISPLAY(TAB(II*6+100) || TAB(II*6+101));                           
    TAB(II*6+100) = '0'B;                                             
    DISPLAY(TAB(II*6+100) || TAB(II*6+101));                           
    DISPLAY('END');                                                   
  END;  /*ABCPROG*/


and output below:

Code:
BEGIN

Storage:             100  LBound:             100  HBound:             199

11

11

01

END
Back to top
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 917
Location: The Universe

PostPosted: Wed Apr 11, 2018 7:34 pm
Reply with quote

I am no PL/I expert; I can't answer your query directly. I would like to make a couple of observations.
  • Personally, I do not think the PL/I library should be changing the DCB attributes of the data set specified by the DD statement with DD name SYSPRINT. I think this is an issue you should pursue with IBM. Unfortunately there is no truly "right" answer for this issue so you may find IBM's response less than satisfactory to you. Perhaps true PL/I experts might have more input than I can provide.
  • I do not think inserting tab characters into a data set will result in the behavior you expect. No IBM printer that I know about provides a tab type function, and the PL/I library does not seem to respond to tab characters by inserting the appropriate blanks into the final output line.
  • Based on the Language Reference manual, you can achieve a tab like capability by using COLUMNnnn) in PUT EDIT statements. The Language Reference manual also mentions X(nnn) to "place blank characters in line to establish position," though this does not seem to be a tab type function.
  • It has been my experience that most of the time data sets specified as having variable length records require less space than data sets specified with fixed length records mainly because it is easy to remove trailing blanks in the output line. Roughly 40 years ago I decided to generally prepare data sets with variable length records; other than complaints from people that want to write programs to reprocess print type data sets who are not accustomed to handling VB data sets there have been few problems.
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1315
Location: Vilnius, Lithuania

PostPosted: Wed Apr 11, 2018 10:02 pm
Reply with quote

steve-myers wrote:
I am no PL/I expert; I can't answer your query directly. I would like to make a couple of observations.
  • Personally, I do not think the PL/I library should be changing the DCB attributes of the data set specified by the DD statement with DD name SYSPRINT. I think this is an issue you should pursue with IBM. Unfortunately there is no truly "right" answer for this issue so you may find IBM's response less than satisfactory to you. Perhaps true PL/I experts might have more input than I can provide.

It doesn't. There are defaults, and they could be found by RTFM. If they are not coded in the JCL or on the DCL SYSPRINT statement, the only thing that actually changes them from the defaults is the use of a DCL 1 PLITABS EXTERNAL structure.

steve-myers wrote:

  • I do not think inserting tab characters into a data set will result in the behavior you expect. No IBM printer that I know about provides a tab type function, and the PL/I library does not seem to respond to tab characters by inserting the appropriate blanks into the final output line.

His TAB variable has nothing to do with tab characters. It's an array of BIT(1) variables. Read about the PLITABS structure to set up columnar output data.

And as for your last two answers/observations, they are not really (or really not...) relevant to the question.

And finally, using DISPLAY to put data on SYSPRINT has only been possible since Enterprise PL/I introduced a compiler option to do so. Normally you should use PUT DATA/PUT LIST/PUT EDIT to print data to SYSPRINT. It's not unlikely that the Runtime library routines that translate DISPLAY (which normally goes to the Console) into a format that goes to SYSPRINT do not respect the default DCB. You should enter an RFE on the IBM developerworks site. (All current PL/I RFEs are @ www.ibm.com/developerworks/rfe/execute?use_case=searchRFEs&SAVED_SEARCH_ID=3071 )
Back to top
View user's profile Send private message
Alan Playford

New User


Joined: 22 Aug 2012
Posts: 48
Location: UK

PostPosted: Thu Apr 12, 2018 2:37 pm
Reply with quote

Thank you both Steve and Prino for replying.

This program, unfortunately, is one of a couple of thousand that we inherited to run for another Customer, and so - although we wouldn't advocate doing anything like this in the same way - our hands are a little tied if we don't want to have to change the program and/or JCL for these 2000+ instances?

Agree that TAB is confusing here, and it's really short for TABLE I guess?
Not that "tabbing" in a DISPLAY statement shouldn't work, as it's only laying out the print line ready for display on the output device.

Online docs variously say SYSPRINT defaults to a STREAM PRINT environment but some say 121 bytes, others say VB, and there appears to be no definite statement to tell you just what DCB parameters it assigns it with.

Appreciate you taking the time and trouble to reply, guys.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> PL/I & Assembler

 


Similar Topics
Topic Forum Replies
No new posts Running a Job with the Default User ID JCL & VSAM 2
No new posts Passing SYSPRINT to Invoked Program PL/I & Assembler 9
No new posts Change Default Scroll Setting TSO/ISPF 1
No new posts Define default volume for DSN storage... JCL & VSAM 8
No new posts fetch the record number from FMNMAIN ... CLIST & REXX 10
Search our Forums:

Back to Top