Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is there a maximum size for working storage? 5

Status
Not open for further replies.

slb0423

Programmer
Dec 11, 2002
2
US
We just ran into a problem where it seems that working storage section is too big, causing strange abends. Can someone tell me what the max size for working storage is? Is this a setting we can modify on our system? Thanks in advance.
 
Hi,

it depends on your platform. IBM's mainframe compiler has not so many limits, look at them hereafter. When the compiler compiles the program an you can also link-edit it, there is also no problem.

Perhaps you don't have enough storage. On IBM mainframe you can give the parm:

REGION=0M

on the JOB statement.

But the best thing is to tell us what happened, what kind of abend you had, etc.

Regards,

Crox


Code:
   | Table 54. Compiler limits                                                 |                                        
   |_____________________________________________ _____________________________|                                        
   | Language element                            | Compiler limit              |                                        
   |_____________________________________________|_____________________________|                                        
   | Size of program                             | 999,999 lines               |                                        
   |_____________________________________________|_____________________________|                                        
   | Size of file record size (AIX and Windows)  | 64K                         |                                        
   |_____________________________________________|_____________________________|                                        
   | Number of literals                          | 4,194,303(1)                |                                        
   |_____________________________________________|_____________________________|                                        
   | Total length of literals                    | 4,194,303 bytes(1)          |                                        
   |_____________________________________________|_____________________________|                                        
   | Reserved word table entries                 | 1536                        |                                        
   |_____________________________________________|_____________________________|                                        
   | COPY REPLACING ... BY ... (items per COPY   | No limit                    |                                        
   | statement)                                  |                             |                                        
   |_____________________________________________|_____________________________|                                        
   | Number of COPY libraries                    | No limit                    |                                        
   |_____________________________________________|_____________________________|                                        
   | Block size of COPY library                  | 32,767 bytes                |                                        
   |_____________________________________________|_____________________________|                                        
   | Identification Division                     |                             |                                        
   |_____________________________________________|_____________________________|                                        
   | Environment Division                        |                             |                                        
   |_____________________________________________|_____________________________|                                        
   | Configuration Section                       |                             |                                        
   |_____________________________________________|_____________________________|                                        
   | SPECIAL-NAMES paragraph                     |                             |                                        
   |_____________________________________________|_____________________________|                                        
   | function-name IS                            | 18                          |                                        
   |_____________________________________________|_____________________________|                                        
   | UPSI-n ... (switches)                       | 0-7                         |                                        
   |_____________________________________________|_____________________________|                                        
   | alphabet-name IS ...                        | No limit                    |                                        
   |_____________________________________________|_____________________________|                                        
   | literal THRU/ALSO ...                       | 256                         |                                        
   |_____________________________________________|_____________________________|                                        
   | Input-Output Section                        |                             |                                        
   |_____________________________________________|_____________________________|                                        
   | FILE-CONTROL paragraph                      |                             |                                        
   |_____________________________________________|_____________________________|                                        
 | | SELECT file-name ...                        | A maximum of 65,535 file    |                                        
 | |                                             | names can be assigned       |                                        
 | |                                             | external names              |                                        
   |_____________________________________________|_____________________________|                                        
 | | ASSIGN system-name ...                      | No limit                    |                                        
   |_____________________________________________|_____________________________|                                        
   | ALTERNATE RECORD KEY data-name ...          | 253                         |                                        
   |_____________________________________________|_____________________________|                                        
   | RECORD KEY length                           | No limit(3)                 |                                        
   |_____________________________________________|_____________________________|                                        
   | RESERVE integer (buffers)                   | 255(4)                      |                                        
   |_____________________________________________|_____________________________|                                        
   | I-O-CONTROL paragraph                       |                             |                                        
   |_____________________________________________|_____________________________|  
   | RERUN ON system-name ...                    | 32,767                      |  
   |_____________________________________________|_____________________________|
   |     integer RECORDS                         | 16,777,215                  |
   |_____________________________________________|_____________________________|
   | SAME RECORD AREA                            | 255                         |
   |_____________________________________________|_____________________________|
   |     FOR file-name ...                       | 255                         |
   |_____________________________________________|_____________________________|
   | SAME SORT/MERGE AREA                        | No limit(2)                 |
   |_____________________________________________|_____________________________|
   | MULTIPLE FILE ... file-name                 | No limit(2)                 |
   |_____________________________________________|_____________________________|
   | Data Division                               |                             |
   |_____________________________________________|_____________________________|
   | File Section                                |                             |
   |_____________________________________________|_____________________________|
   | FD file-name ...                            | 65,535                      |
   |_____________________________________________|_____________________________|
   |     LABEL data-name ... (if no optional     | 255                         |
   | clauses)                                    |                             |
   |_____________________________________________|_____________________________|
   |     Label record length                     | 80 bytes                    |
   |_____________________________________________|_____________________________|
   |     DATA RECORD dnm ...                     | No limit(2)                 |
   |_____________________________________________|_____________________________|
 | |     BLOCK CONTAINS integer                  | 2,147,483,647 (OS/390)(8)   |
 | |                                             | 1,048,575 (other            |
 | |                                             | platforms)(5)               |
   |_____________________________________________|_____________________________|
   |     RECORD CONTAINS integer                 | 1,048,575(5)                |
   |_____________________________________________|_____________________________|
   |     Item length                             | 1,048,575 bytes(5)          |
   |_____________________________________________|_____________________________|
 | |     LINAGE clause values                    | 99,999,999                  |
   |_____________________________________________|_____________________________|
   | SD file-name ...                            | 65,535                      |
   |_____________________________________________|_____________________________|
   |     DATA RECORD dnm ...                     | No limit(2)                 |
   |_____________________________________________|_____________________________|
   |     Sort record length                      | 32,751 bytes                |
   |_____________________________________________|_____________________________|
   | Working-Storage Section                                                   |
   |_____________________________________________ _____________________________|
   | Items without the EXTERNAL attribute        | 134,217,727 bytes           |
   |_____________________________________________|_____________________________|
   | Items with the EXTERNAL attribute           | 134,217,727 bytes           |
   |_____________________________________________|_____________________________|
   | 77 data-names                               | 16,777,215 bytes            |
   |_____________________________________________|_____________________________|
   | 01-49 data-names                            | 16,777,215 bytes            |
   |_____________________________________________|_____________________________|
   | 88 condition-name ...                       | No limit                    |
   |_____________________________________________|_____________________________|
   | VALUE literal ...                           | No limit                    |
   |_____________________________________________|_____________________________|
   | 66 RENAMES ...                              | No limit                    |
   |_____________________________________________|_____________________________|
 | | PICTURE character-string                    | 50                          |
   |_____________________________________________|_____________________________|
 | |     Numeric item digit positions            | If the ARITH(COMPAT)        |
 | |                                             | compiler option is in       |
 | |                                             | effect: 18                  |
   |                                             |                             |
 | |                                             | If the ARITH(EXTEND)        |
 | |                                             | compiler option is in       |
 | |                                             | effect: 31                  |
   |_____________________________________________|_____________________________|
   |     Numeric-edited character positions      | 249                         |
   |_____________________________________________|_____________________________|
   | PICTURE replication (   )                   | 16,777,215                  |
   |_____________________________________________|_____________________________|
   | PIC repl (editing)                          | 32,767                      |
   |_____________________________________________|_____________________________|
   | DBCS Picture replication (   )              | 8,388,607                   |
   |_____________________________________________|_____________________________|
   | Group item size: File Section               | 1,048,575 bytes             |
   |_____________________________________________|_____________________________|
   | Elementary item size                        | 16,777,215 bytes            |
   |_____________________________________________|_____________________________|
   | VALUE initialization (Total length of all   | 16,777,215 bytes            |
   | value literals)                             |                             |
   |_____________________________________________|_____________________________|
   | OCCURS integer                              | 16,777,215                  |
   |_____________________________________________|_____________________________|
   |     Total number of ODOs                    | 4,194,303(1)                |
   |_____________________________________________|_____________________________|
   |     Table size                              | 16,777,215 bytes            |
   |_____________________________________________|_____________________________|
   |     Table element size                      | 8,388,607 bytes             |
   |_____________________________________________|_____________________________|
   |     ASC/DES KEY ... (per OCCURS clause)     | 12 KEYS                     |
   |_____________________________________________|_____________________________|
   |     Total length                            | 256 bytes                   |
   |_____________________________________________|_____________________________|
   |     INDEXED BY ... (index names) (per       | 12                          |
   | OCCURS clause)                              |                             |
   |_____________________________________________|_____________________________|
   |     Total num of indexes (index names)      | 65,535                      |
   |_____________________________________________|_____________________________|
   |     Size of relative index                  | 32,765                      |
   |_____________________________________________|_____________________________|
   | Linkage Section                             | 134,217,727 bytes           |
   |_____________________________________________|_____________________________|
   | Total 01 + 77 (data items)                  | No limit                    |
   |_____________________________________________|_____________________________|
   | Procedure Division                          |                             |
   |_____________________________________________|_____________________________|
   | Procedure + constant area                   | 4,194,303 bytes(1)          |
   |_____________________________________________|_____________________________|
   |     USING identifier ...                    | 32,767                      |
   |_____________________________________________|_____________________________|
   | Procedure-names                             | 1,048,575(1)                |
   |_____________________________________________|_____________________________|
   |     Subscripted data-names per verb         | 32,767                      |
   |_____________________________________________|_____________________________|
   |     Verbs per line (TEST)                   | 7                           |
   |_____________________________________________|_____________________________|
   | ADD identifier ...                          | No limit                    |
   |_____________________________________________|_____________________________|
   | ALTER pn1 TO pn2 ...                        | 4,194,303(1)                |
   |_____________________________________________|_____________________________|
   | CALL ... BY CONTENT id                      | 2,147,483,647 bytes         |
   |_____________________________________________|_____________________________|
   | CALL id/lit USING id/lit...                 | 16380 (OS/390 and VM) 500   |
   |                                             | (AIX and Windows)           |
   |_____________________________________________|_____________________________|
   | CALL literal ...                            | 4,194,303(1)                |
   |_____________________________________________|_____________________________|
   |     Active programs in run unit             | 32,767                      |
   |_____________________________________________|_____________________________|
   |     Number of names called (DYN)            | No limit                    |
   |_____________________________________________|_____________________________|
   | CANCEL id/lit ...                           | No limit                    |
   |_____________________________________________|_____________________________|
   | CLOSE file-name ...                         | No limit                    |
   |_____________________________________________|_____________________________|
   | COMPUTE identifier ...                      | No limit                    |
   |_____________________________________________|_____________________________|
   | DISPLAY id/lit ...                          | No limit                    |
   |_____________________________________________|_____________________________|
   | DIVIDE identifier ...                       | No limit                    |
   |_____________________________________________|_____________________________|
   | ENTRY USING id/lit ...                      | No limit                    |
   |_____________________________________________|_____________________________|
   | EVALUATE ... subjects                       | 64                          |
   |_____________________________________________|_____________________________|
   | EVALUATE ... WHEN clauses                   | 256                         |
   |_____________________________________________|_____________________________|
   | GO pn ... DEPENDING                         | 255                         |
   |_____________________________________________|_____________________________|
   | INSPECT TALLY/REPL clauses                  | No limit                    |
   |_____________________________________________|_____________________________|
   | MERGE file-name ASC/DES KEY ...             | No limit                    |
   |_____________________________________________|_____________________________|
   |     Total key length                        | 4,092 bytes(6)              |
   |_____________________________________________|_____________________________|
   |     USING file-name ...                     | 16(7)                       |
   |_____________________________________________|_____________________________|
   | MOVE id/lit TO id ...                       | No limit                    |
   |_____________________________________________|_____________________________|
   | MULTIPLY identifier ...                     | No limit                    |
   |_____________________________________________|_____________________________|
   | OPEN file-name                              | No limit                    |
   |_____________________________________________|_____________________________|
   | PERFORM                                     | 4,194,303                   |
   |_____________________________________________|_____________________________|
   | SEARCH ... WHEN ...                         | No limit                    |
   |_____________________________________________|_____________________________|
   | SET index/id ... TO                         | No limit                    |
   |_____________________________________________|_____________________________|
   | SET index ... UP/DOWN                       | No limit                    |
   |_____________________________________________|_____________________________|
   | SORT file-name  ASC/DES KEY                 | No limit                    |
   |_____________________________________________|_____________________________|
   |     Total key length                        | 4,092 bytes(6)              |
   |_____________________________________________|_____________________________|
   |     USING file-name ...                     | 16(7)                       |
   |_____________________________________________|_____________________________|
   | STRING identifier ...                       | No limit                    |
   |_____________________________________________|_____________________________|
   |     DELIMITED id/lit ...                    | No limit                    |
   |_____________________________________________|_____________________________|
   | UNSTRING DELIMITED id/lit OR id/lit ...     | 255                         |
   |_____________________________________________|_____________________________|
   | UNSTRING INTO id/lit ...                    | No limit                    |
   |_____________________________________________|_____________________________|
   | USE ... ON file-name ...                    | No limit                    |
   |_____________________________________________|_____________________________|
 
We were receiving a SOC4. Basically our load module was trying to load an external table. Well the datanames used in the call to the load module were defined at the end of the working storage. We took the production version of the program and recompiled with a new version of a copybook that added datanames. This seems to have "knocked" off the datanames at the end of working storage so they were not able to pass the correct info to the load module, only garbage was being passed. When we put the old version of the copybook in, everything worked fine. We found some unused datanames and deleted those from working storage, then recompiled with the new copybook. Now everything is working fine. Thus, I was wondering if there was any kind of limit on the size of working storage. Why else would it seem that it is getting "full".

Did that make any sense?
 
Hi,

I guess that you had a moment that you worked with the smaller size of the link-field. That is also the reason that you got a S0c4 which means that you are trying to address storage that isn't yours.

Regards,

Crox
 
Hi SBL,

It's difficult to envision your situation from your text description. Perhaps you can provide copies of the WS copybook, the CALL stmt in the mainline pgm, the Linkage Section, the Procedure Division stmt, and the abending stmt in the subpgm.

I would imagine exceeding the WS size limit would evoke a fatal error in the compile step. I agree w/Crox that the change in the copybook created a mismatch in the the descriptions of the size of the field being passed from the mainline to the subpgm.

But this can't be proved without the info I described.

Regards, Jack.
 
I'm not sure if this would be the thread to address for my question, but here goes...

I'm wanting to search for matches of names from a string input from the user. I already understand how to do this using the INSPECT statement, etc. The match includes finding "nathan" in a record with a name field that might be "johnathan", for example. I've accomplished this.

The problem is, in order for me to tally all of my matches for all name fields from each record in my file, I have to loop through and check each name field on each iteration of my read-next loop. This takes a lot of time somewhere around 12 seconds to tally all the matches for only 1 string being input by the user. Therefore, I'm guessing it's going to take potentially way too much time when I start coding for a batch process to match names from a file against my database file.

I just want to know if there are any suggestions anyone might have to solve or speed up my name search code.

I am running on AIX with RM/COBOL-85. The file I'm reading against for name matches has a records with a length of approx. 2,000 and there are about 5,000 records.
My current file type is Indexed. If I'm not mistaken, I wouldn't be able to write my data to a sequential file with 1 long record as there is only a max length of 65,280 allowed.

Please give me any suggestions that might speed up the name matching process for me.

Thanks in advance.
 
They use an interesting method for doing this with the US Census for finding similar sounding names that may not be exact matches. It uses a soundex code.

If you do not like my post feel free to point out your opinion or my errors.
 
Hi,

instead of searching in the field, you can perhaps inspect the field and extract the 'words': text that ends with a space or a dot or something. Those words you search in a table with a binary search. Suppose you find 4 name-words in the name field, with the binary search you only do 4 search all's in your table with names (in core of course) and not the cpu-consuming inspects.

I hope you understand the general idea. If not, ask!

Regards,

Crox
 
Thanks.

I'm not sure I understand what you meant. Just to give you a better idea of what I'm doing now with the user's input string....

What I do with the user's input string for name search:
INSPECT INPUT-STRING REPLACING ALL SPACES BY "@".
INSPECT INPUT-STRING TALLYING CTR-1 FOR CHARACTERS
BEFORE INITIAL "@@@".

Perform until file-at-end
....
-read file next record
check file-name-field code:
INSPECT FILE-NAME-FIELD REPLACING ALL SPACES WITH "@"
INSPECT FILE-NAME-FIELD TALLYING CTR-2 FOR ALL
INPUT-STRING(1:CTR-1)
....
End Perform

This works, but it takes about 12 seconds to run through and find matching strings on each of the 5000 records' name-fields.

I didn't understand what you meant by searching in a table with a binary search instead of doing what I'm doing. Can you please clarify?

Thanks a lot.
 
Elvis -

I'm sure we're not clear about exactly what you're doing either. Sounds to me like:

1. You're given a name from user input.
2. You go through each record of your 5000 record file and examine a field to see if the name appears somewhere in that field. If so, you increment a count.
3. The field you're examining is free text. That is, the name could appear anywhere zero, one, or more times in the field.

If the problem is different, e.g. you're given a list of names to check against the user input, then a binary search might make sense (put all the given names in a table, in sorted order, and use the SEARCH ALL verb). Binary search is VERY fast.

Given your file is only 1meg in size (2000 bytes x 5000 records), you might consider keeping it (or relevant portions of it) in memory in a large table. That avoids much of the IO (in favor, perhaps of swap IO which is usually faster/well-managed by the OS).

BTW "I'm not sure if this would be the thread to address for my question, but here goes..." - this is a new question and you should have started a new thread.

Regards.

Glenn
 
Glen:

Yes, I have the file built with names and other information for each record, address, etc. which I spit out for each that is a match of the string input by the user. So, I guess, from your comment about my file being 1 meg, your saying I could load the data from that file into a large table in my working storage and do my searches through the working storage array of records?

In both situations, binary and the one above, you mention putting it into a table, and I'm guessing you mean a table in my working storage section, right?

Given your file is only 1meg in size (2000 bytes x 5000 records), you might consider keeping it (or relevant portions of it) in memory in a large table. That avoids much of the IO (in favor, perhaps of swap IO which is usually faster/well-managed by the OS).
 
OOPS |-I

Well, perhaps significantly less than 2k/record would really need to be stored.

Glenn
 
Amarillo,

Is your 5000 record file rather static? If so, based on my presumtions, perhaps you can create an indexed file that allows you quickly to find all the records that qualify.

If your 5000 record file is not already an indexed file, it will need to be made into an indexed file. This is probably a good idea, as an RM/COBOL indexed file will probably use less space than the corresponding sequential file.

Then create a second indexed file, which has as its key the name which may be found in FILE-NAME-FIELD in the record of the first file, the key of which is the other field in this second file:
Code:
01  NAME-INDEX-RECORD.
    02  NAME-IN-RECORD   PIC X(100).
    02  KEY-OF-MAIN-FILE PIC X(whatever).
This file will have a record for each name found in the first file. That is, if a particular record has 22 names in FILE-NAME-FIELD, then this file will have 22 records, each having KEY-OF-MAIN-FILE pointing to the same record.

Then, for a given name:
Code:
MOVE INPUT-STRING(1:CTR-1) TO NAME-IN-RECORD.
START NAME-INDEX-FILE KEY = NAME-IN-RECORD
   INVALID KEY
      DISPLAY "No record exists with that name."
   NOT INVALID KEY
      loop here to read all the records where
      NAME-IN-RECORD equals INPUT-STRING (1:CTR-1)
      then MOVE KEY-OF-MAIN-FILE to MAIN-FILE-KEY
      READ MAIN-FILE and you've got the record
END-START.

(RM/COBOL supports duplicate primary keys, which helps here.)

Since RM/COBOL indexed files compress keys and data, I think you will find that this is a practical means of eliminating this performance bottleneck in a straightforward manner.

Tom Morrison
 
Thanks, but I'm not sure if that will do the trick.
I've got my index file built already. It has records(about 5000) with a record length of approx. 2000.
By the way, on my AIX platform running RM/COBOL - 85 I didn't have any luck labelling PRIMARY KEY IS NAME-FIELD WITH DUPLICATES. Upon compiling with primary key with duplicates on it in my select statement, I received a 0501 error - Source Language feature not supported by specific version of ....

However, all my ALTERNATE KEYS are allowed DUPLICATES and that compiles and runs fine as is.

Basically, the conflict I have with the code I have set up for searching all name fields(up to 3 name fields per record) on all records using my INSPECT statement and checking every single record, is that it takes 13 seconds to do this for only 1 input string.

I've researched the use of building a table with all my name fields in my WS section and then using the SEARCH ALL.
As mentioned above by others, it will be a binary search.

The problem is, I have to match for strings as well as EXACT name matches. So, the INPUT-STRING might be "Nathan", but it should match with records that have "Nathan" as WELL as records that have "Jonathan" etc. I've got this accomplished looping through every record of my DataFile(indexed file). But the 13 seconds is just not satisfactory. So, I don't know that creating an extra Indexed File here would solve it. I'm going to see if I can put my INSPECT logic from the old 13-second-code I have into the WHEN clause of my SEARCH-ALL block. Hopefully, if that is syntactically acceptable, it won't adversely affect the speed of using the binary SEARCH ALL.

Thanks for the help.
Elvis


 
1. Your version of RM/COBOL must be old. v7.50 is current, and v8 won't be too far off...

2. Seems to me that you can table just the NAME-FIELD, and the file's key value (perhaps 50 characters?) if you need to be able to fetch the record, for: 250 x 5000 = 1250000 which, while large, isn't too bad. This is what Glenn was suggesting. You would need only to do the prep work (replacing spaces with @ on FILE-NAME-FIELD) once per record, no matter how many lookups you will do.

3. Since you have to detect embedded names (Nathan finds Jonathan), it would seem that you still need to loop through the entire table for each name entered, but without the IO and 'prep work' overhead.

Tom Morrison
 
As I mentioned on another thread about string searching, the quickest way to do caseless search is to convert the two strings to upper (or lower) case before searching.

If your version of COBOL allows variable length strings in INSPECT, then find the length of the search string and do

MOVE ZERO TO counter
INSPECT target_string TALLYING counter FOR CHARACTERS
BEFORE INITIAL search_string(1:search_string_length)

If you can't do that, then do

COMPUTE limit = length_of_target_string -
- length_of_search-string
+ 1
PERFORM VARYING counter from 1 by 1 UNTIL counter > limit
OR target_string(counter:length_of_search_string)
= search_string(1:length_of_search_string)
CONTINUE
END-PERFORM

In the first case, if counter > length of target string, then you found a match. In the second case, if counter > limit, then you found a match.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top