Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Default attributes for undeclared SYSPRINT in PL/1

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
View previous topic :: :: View next topic  
Author Message
Alan Playford

New User


Joined: 22 Aug 2012
Posts: 30
Location: UK

PostPosted: Wed Apr 11, 2018 5:18 pm    Post subject: Default attributes for undeclared SYSPRINT in PL/1
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: 667
Location: The Universe

PostPosted: Wed Apr 11, 2018 7:34 pm    Post subject:
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: 1119
Location: Oostende, Belgium

PostPosted: Wed Apr 11, 2018 10:02 pm    Post subject:
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 @ https://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: 30
Location: UK

PostPosted: Thu Apr 12, 2018 2:37 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to control Panel Attributes throu... rsshanmugam CLIST & REXX 3 Mon Feb 26, 2018 9:51 pm
No new posts Default FTP options vasanthz All Other Mainframe Topics 2 Fri Aug 25, 2017 5:58 am
No new posts Default Message in Rexx cvnlynn CLIST & REXX 9 Wed Aug 02, 2017 12:38 am
No new posts DFSORT - Overriding default option TU... Steve Ironmonger DFSORT/ICETOOL 3 Tue Apr 04, 2017 3:54 pm
No new posts ICETOOL/SYNCSORT - SYSPRINT output nartcr DFSORT/ICETOOL 17 Wed Oct 05, 2016 10:46 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us