Search found 439 matches

by William Collins
Wed Jun 11, 2014 1:37 pm
Forum: IBM COBOL, GnuCOBOL (OpenCOBOL), OOCobol.
Topic: How to calculate STRING length?
Replies: 9
Views: 5054

Re: How to calculate STRING length?

You can have a variable-length field (the amount of storage allocated is fixed) using OCCURS DEPENDING ON. It is still not a "string", because a string would be terminated, instead of this the variable-length field has a length.
by William Collins
Wed Jun 11, 2014 12:28 pm
Forum: IBM COBOL, GnuCOBOL (OpenCOBOL), OOCobol.
Topic: COBOL decimal number limit.
Replies: 3
Views: 2989

Re: COBOL decimal number limit.

ARITH(EXTEND) also increases the number of significant digits for COMP-1/COMP-2 floating-point data. Note that floating-point values are an "approximation" of a true decimal value. Sometimes a little off down a number of decimal places.
by William Collins
Tue Jun 10, 2014 3:01 pm
Forum: Interview Questions.
Topic: Cobol interview question.
Replies: 3
Views: 1346

Re: Cobol interview question.

You're answering a different question to the one asked.

Make yourself a little program, which reads a file. Set up the program so it abends on the 10th read (or any number of your choice). Look at the formatted dump to see where you can find it telling you that 10 records were read.
by William Collins
Tue Jun 10, 2014 2:24 pm
Forum: IBM COBOL, GnuCOBOL (OpenCOBOL), OOCobol.
Topic: COBOL decimal number limit.
Replies: 3
Views: 2989

Re: COBOL decimal number limit.

For decimal (zoned or packed) 31 digits is the maximum, achieved, as you have pointed out correctly, by using compiler option ARITH(EXTEND). With ARITH(COMPAT) the maximum is 18 digits.
by William Collins
Mon Jun 09, 2014 2:00 pm
Forum: IBM COBOL, GnuCOBOL (OpenCOBOL), OOCobol.
Topic: Stop Run in both called and calling programs.
Replies: 8
Views: 2936

Re: Stop Run in both called and calling programs.

STOP RUN causes return to the Operating System. GOBACK causes return to the program which called it. In the case of the program which is the entry-point used to satisfy EXEC PGM=... in the JCL, the Operating System has "called" the program, so STOP RUN and GOBACK give the same results. It ...
by William Collins
Mon Jun 09, 2014 12:22 pm
Forum: IBM COBOL, GnuCOBOL (OpenCOBOL), OOCobol.
Topic: Using SEARCH without setting INDEX in COBOL.
Replies: 14
Views: 2966

Re: Using SEARCH without setting INDEX in COBOL.

You could try to install GNU COBOL (formerly OpenCOBOL) to try things out.

It is unclear what you mean exactly by "definiing INDEX is mandatory". SEARCH does no definitions at all.
by William Collins
Mon Jun 09, 2014 12:18 pm
Forum: IBM COBOL, GnuCOBOL (OpenCOBOL), OOCobol.
Topic: How to calculate STRING length?
Replies: 9
Views: 5054

Re: How to calculate STRING length?

If we assume a "string" to be a binary-zero-delimited piecs of data (the binary zero usually represented as /n) then COBOL does not have that. COBOL has fixed-lenth fields, which will be "padded" to the right with spaces if the data is short of the field-length and truncated to t...
by William Collins
Thu Jun 05, 2014 6:41 pm
Forum: IBM COBOL, GnuCOBOL (OpenCOBOL), OOCobol.
Topic: Difference between NEXT Sentence and Continue.
Replies: 19
Views: 9627

Re: Difference between NEXT Sentence and Continue.

No. In the third example, there is no full-stop/period for the END-IF, so NEXT SENTENCE will find the next full-stop/period in the program, and transfer control to that point. At the very least, MOVE C TO D will not be executed when the NEXT SENTENCE leg of the IF is true. A casual look at the code,...
by William Collins
Wed Jun 04, 2014 4:44 pm
Forum: IBM COBOL, GnuCOBOL (OpenCOBOL), OOCobol.
Topic: What is EXHIBIT?
Replies: 3
Views: 2522

Re: What is EXHIBIT?

EXHIBIT was in IBM's ANS and OS/VS COBOL compilers (perhaps earlier ones as well). It disappeared when COBOL II arrived (along with EXAMINE and TRANSFORM). I think they were all IBM Language Extensions. If you come across them in code, the programs have likely not been changed for a long time. Follo...
by William Collins
Wed May 28, 2014 3:24 pm
Forum: IBM DFSort, ICETOOL, ICEMAN, ICEGENER.
Topic: ICETOOL and ICEMAN in DFSORT - are they same?
Replies: 9
Views: 6122

Re: ICETOOL and ICEMAN in DFSORT - are they same?

If you locate Summary of Changes for SC26-7523-04 z/OS Version 1 Release 11 (PTFs - November 2009) in the DFSORT Application Programming Guide, you should find the introduction of ICETOOL Operator MERGE.
by William Collins
Tue May 20, 2014 7:59 pm
Forum: IBM COBOL, GnuCOBOL (OpenCOBOL), OOCobol.
Topic: Difference between NEXT Sentence and Continue.
Replies: 19
Views: 9627

Re: Difference between NEXT Sentence and Continue.

Yes, off-topic. I do the same as Nic, with extra brackets. As a means of simplification it works more often than not, in my experience. The average COBOL coder writes under-average code in general and if it is something important, like a condition, more so. The compiler always understands the way it...
by William Collins
Tue May 20, 2014 7:39 pm
Forum: IBM COBOL, GnuCOBOL (OpenCOBOL), OOCobol.
Topic: Difference between NEXT Sentence and Continue.
Replies: 19
Views: 9627

Re: Difference between NEXT Sentence and Continue.

You/re right, Nic. CONTINUE as a replacement for NEXT SENTENCE can be avoided, and I'd code it almost as you have shown (unless site-standards disallow).
by William Collins
Tue May 20, 2014 6:05 pm
Forum: IBM COBOL, GnuCOBOL (OpenCOBOL), OOCobol.
Topic: Difference between NEXT Sentence and Continue.
Replies: 19
Views: 9627

Re: Difference between NEXT Sentence and Continue.

Yes, but that's not much use as an illustration of NEXT SENTENCE/CONTINUE :-)

Nice pink, by the way.
by William Collins
Tue May 20, 2014 4:30 pm
Forum: IBM COBOL, GnuCOBOL (OpenCOBOL), OOCobol.
Topic: Difference between NEXT Sentence and Continue.
Replies: 19
Views: 9627

Re: Difference between NEXT Sentence and Continue.

If may be easier if you can let us know what you think the difference is, or what you are unsure about. My rule is not not use NEXT SENTENCE in any new code, but instead to use CONTINUE and END-IF. The confusion arises because IBM went against the 1985 ANSI Standard, and allowed NEXT SENTENCE with I...
by William Collins
Mon May 19, 2014 6:25 pm
Forum: IBM COBOL, GnuCOBOL (OpenCOBOL), OOCobol.
Topic: MOVE and LOW-VALUES.
Replies: 4
Views: 3848

Re: MOVE and LOW-VALUES.

You can't MOVE LOW-VALUES TO a-binary-field. If you change it to MOVE ZERO it will compile and your field will get zero in it. Reason is, LOW-VALUES is a COBOL Figurative Constant relating to the collating sequence used in your program. What relevance would collating-sequence have to a binary field?...
by William Collins
Mon May 19, 2014 5:26 pm
Forum: IBM COBOL, GnuCOBOL (OpenCOBOL), OOCobol.
Topic: Using SEARCH without setting INDEX in COBOL.
Replies: 14
Views: 2966

Re: Using SEARCH without setting INDEX in COBOL.

It depends on what you are trying to do. Have you looked at the documentation, it should be clear what will happen.
by William Collins
Mon May 19, 2014 12:48 am
Forum: IBM COBOL, GnuCOBOL (OpenCOBOL), OOCobol.
Topic: Why INITIAILIZE is not that preffered in COBOL.
Replies: 9
Views: 2977

Re: Why INITIAILIZE is not that preffered in COBOL.

Well, what would you like to use INITIALIZE for, and why?

Is there some more detailed description than "not good coding practice" for the standards are your site?
by William Collins
Thu May 08, 2014 4:45 pm
Forum: Interview Questions.
Topic: IBM Mainframes interview questions.
Replies: 7
Views: 1784

Re: IBM Mainframes interview questions.

Yes, agreed. If a question does not make sense in itself, follow up. Sometimes that will be the reason for the question. Sometimes the interviewer has no particular knowledge, and is presenting the question approximately as given to them and expecting a "stock" answer, and does not know th...
by William Collins
Thu May 08, 2014 3:21 pm
Forum: Interview Questions.
Topic: IBM Mainframes interview questions.
Replies: 7
Views: 1784

Re: IBM Mainframes interview questions.

Well, you have something with 128MB. The largest useful value would be one which could cover the maximum number of entries allowed in a table. If you consult Appendix B of the Enterprise COBOL Language Reference, you should find the maximum value for an OCCURS and that would be the maximum useful va...
by William Collins
Tue May 06, 2014 12:19 pm
Forum: Interview Questions.
Topic: Index and Subscript?
Replies: 13
Views: 5638

Re: Index and Subscript?

You don't have to worry about calulating it. The compiler does it for you. By the time you are able to locate an index in a dump, you'll be comfortable with how it was calculated.

Go to advanced search