TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Murray Lesser
from: David Noon
date: 1996-07-23 22:21:04
subject: PL/I Problems 1/

>thus requiring an OS/2 DD:PRINTER=PRN line.  Forget that one; it was
  >pilot error!  I was using TITLE('PRN') instead of TITLE('/PRN').  Wonder
  >how many reported bugs are pilot error?

Hi Murray,

I received both messages in the same QWK packet.

What you specified in the former case was the DDNAME that would have
appeared in the OS JCL to allocate the file under MVS, nowadays OS/390.
So, instead of the JCL

  //  DD  

under OS/2 you use:

  SET DD:=

I think this feature was implemented because most PL/I programmers
expect to code JCL. Habits of decades are hard to break.

ML>   The second complaint, that the compiler couldn't recognize
  >zero-length input lines when reading an ASCII file until it had read one
  >or more lines having some content, is not pilot error.

Hmm. I think it's time for Clem Clarke to stop lurking. I remember him
saying he discussed this limitation, inherited from the mainframe, with
Davinder Athwal a couple of years ago. It should no longer be in the
RTL. Zero-length records should be supported in both STREAM and RECORD
modes. I vaguely recall he persuaded Davinder that they should be
treated as per mainframe assembler, which would be to put a zero valued
length field into a CHAR(*) VAR work area.

However, in STREAM mode the leading lines would be skipped, since they
have no information content unless you are using the L format item. But
they should not be skipped until a format item other than L is
encountered, or a LIST or DATA request is made.

ML>    I think this omission of the initial blank lines when reading an
  >ASCII file is a real bug (or else a design decision!).

I would expect a bug, since the later zero-length records are returned.

  >comparison.)  If you have time, and can confirm the symptoms with the
  >Professional Edition compiler, I will send the "bug" in to Carolyn at

I will send you my test case by private e-mail, unless others in this
echo express an interest. It will be next weekend (27-28 July) before I
can get it done. Expect something on Monday.

ML>How do I read an ASCII text file
  >(produced, say, by a text editor) as a set of fixed-length records?

Either of 2 ways, each using the file declared with RECORD rather than
STREAM processing.

Fast way:
Open it with TYPE(U) and use the FILEREAD() built-in function with the
length parameter set to the desired record length. Any short record will
be the last bytes of the file.

Classic way:
Declare the the file with RECSIZE(xxx), where 'xxx' is your fixed record
size, open it with TYPE(DDM) /* check the DDM attribute - I'm using
NT and don't have my .INF files handy */ and EA(N) to stop the search
for file type EA's, and use conventional READ statements. Note that the
file size _must_ be an exact integer multiple of the RECSIZE() or the
RTL will [quite rightly] smell a rat and signal the RECORD() condition
to abend your program, probably on the last record.

ML>    Slight change in subject:  I sent a message to Carolyn (she should
  >find it in her e-mail file tomorrow) asking if release 1.2 allows
  >stand-alone executables. If so, it might even be worth the money to me.

According to Peter Elderon it should be selectable, just like IBM's
C/C++ compilers. This information is some months old, though, and in
IBM things are subject to change.

  >The next query is to see if you get hard-copy docs with the upgrade, and

I would expect 1 copy of the docs, since the multi-licence upgrade has
scales for additional copies over the 1 supplied copy.

BTW, the upgrade price from Professional Edition is $449, so it is
actually more expensive to get to 1.2 for those who bought Prof. Ed.

  >whether or not the employee (retiree, in my case) discount works for the
  >upgrade.  As you see, I am talking myself into spending all that money!

And then you'll need copies of CICS/2 and DB2/2 to exploit all the
additional features. Start saving the pennies now .... :-)

Regards


(Continued to next message)
___
 X QMPro 1.50 42-9134 X I tried switching to gum but couldn't keep it lit

--- Maximus/2 3.01
* Origin: DoNoR/2,Woking UK (44-1483-725167) (2:440/4)
SEEN-BY: 50/99 270/101 620/243 625/100 711/401 409 410 413 430 808 809 934
SEEN-BY: 711/955 712/407 515 624 628 713/888 800/1
@PATH: 440/4 141/209 270/101 712/515 711/808 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.