HP3000-L Archives

July 2007, Week 5

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
"Walter J. Murray" <[log in to unmask]>
Reply To:
Walter J. Murray
Date:
Mon, 30 Jul 2007 21:30:57 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (82 lines)
Duane points out an interesting behavior when using the feature ASSIGN
USING.  The default file size is 1023, not 10,000.  I wasn't aware of
it, but he's right.

To further complicate matters, you can override that feature by
combining ASSIGN TO and USING.  For example,

     SELECT TEST-FILE ASSIGN TO "DUMMY" USING FILE-NAME.

This gives you the file name in the data item FILE-NAME, but defaults to
10,000 records.

You can even do something like this:

     SELECT TEST-FILE ASSIGN TO "DUMMY,,,,5000" USING FILE-NAME.

The name "DUMMY" is ignored, but the file size of 5000 is honored.

There are more possibilities, but I think I'll stop here, especially
since my copy of the COBOL standard is at work.

Personally, I prefer to keep my file sizes in :FILE commands, and out of
my source code.

Duane refers to my working "behind bars".  You don't know how hard it
is.  As my good friend Erik Vistica pointed out once, it's hard
programming in prison, because you're not allowed to have files.  :-)

I'm glad I'm programming on the right side of the bars.  In California,
at least, inmates in state prisons are specifically not allowed to use
COBOL.  No joking.

Walter  

Walter J. Murray
HP class of 2003
Now programming for the California Department of Corrections and
Rehabilitation


-----Original Message-----
From: Duane Percox [mailto:[log in to unmask]] 
Sent: Monday, July 30, 2007 9:47 AM
To: Walter J. Murray; [log in to unmask]
Subject: RE: [HP3000-L] COBOL Sort Max Recs

Walter 'who should know' wrote:

[snip]

>If you don't specify the maximum number of records, the default is
>10,000.

My experience has shown that if you use the form of SELECT where you
specify
a file name in quotes like this:

INPUT-OUTPUT SECTION.
FILE-CONTROL.
    SELECT INPUT-FILE ASSIGN TO "TOMYPROG".
    SELECT SORT-FILE  ASSIGN TO "TMMYPROG".

Then you get a default of 10,000 records.

However, if you use this form of the SELECT:

INPUT-OUTPUT SECTION.
FILE-CONTROL.
    SELECT INPUT-FILE ASSIGN USING WS-INPUT-FILENAME.
    SELECT SORT-FILE  ASSIGN USING WS-SORT-FILENAME.

Then you get a default of 1023 records.

And since the perfect person to fix this is now working behind bars I'm
not
sure it will ever be changed :-)

duane

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2