Here's something we do in report programs to have a real straight forward way to get the headers produced.
01 ACCUMULATOR-AREAS PACKED-DECIMAL.
03 AA-LINE-COUNT VALUE +999 PIC S9(03).
88 AA-FULL-PAGE
VALUES +56 THRU +999...
I would get in a loop until my input file is empty. I would use either IF statemetns or an EVALUATE to check for breaks, checking the most major break first.
EVALUATE TRUE
WHEN COMPANY NOT = SA-COMPANY
PERFORM 9100-PRINT-COMPANY-TOTAL
WHEN DIVISION NOT = SA-DIVISION...
Glenn you may have handled the possibility of 2 names in the city but now you have places like Fond du Lac, WI. Now you have to add code to handle the possibility of 3 names - and maybe there are some with four.
I agree that working backwards is the best approach. You can assume first string...
mrregan:
Your solution is similar to Glenn9999 except he delimited by All SPACE which is what is needed. If the input has 2 leading spaces, with your delimiter, each space is a delimiter and both receiving fields end up with spaces.
ALL will treat both spaces as one delimiter.
A combination of...
Computer Associates has a product that is called Xpediter that seems to do what you were. You compile your program with the Xpediter active and it puts some 'hooks' into your program.
When you execute, you start by setting breakpoints, or lines that you want to stop at and check things out...
The cross-reference has always worked this way where it only gives you an entry that you specifically reference in a statement.
If your counters were defined as zoned decimal, you could MOVE ZEROES TO GROUP-COUNTERS
and the cross-reference never listed the elementary fields as being modified...
Not that it matters a whole lot but the hex equivalent of decimal 20010304 is 01315540.
You could work with this binary field without moving to a zoned decimal if you wanted to. You're trying to subtract 3 years from the date. If you treat the date as an integer such as 20010304, the units...
I tried checking the address for NULL and it won't work in all cases. Seemed that once you called with 4 addresses, it was never null again during that execution.
I had to do just what you're doing a few years ago and got help from this site.
The last parameter sent is marked with a binary...
leewest,
This may be what you are remembering from the past. With this code
IF A = B AND C = D AND E = F
As soon as an untrue condition is encountered, control passes to the ELSE or the next statement if there is no ELSE. When all conditions are connected with AND, as soon as one is false...
In the old days it did create one instruction. I used a Packed field with an odd number of digits and a sign - all the right things. Enterprise COBOL generates a ZAP instruction at the end of most of the calculations it does. So there is a MP and ZAP instruction when a multiply is used.
fyi
Using IBM Enterprise COBOL on a mainframe, it generates 5 Assembler instructions to use COMPUTE and multiplying by
-1. It uses 4 instructions to use COMPUTE with the complement operator. It uses 4 instructions to use COMPUTE and subtract the number from zero. It uses 2 instructions to...
We had the capability years ago using an optimizer from Computer Associates. It optimized the compile code and provided debugging tools that produced a report like you're talking about.
I don't know what these programs are that you're using but it is understandable that the data is not in the same order when you use WITH DUPLICATES IN ORDER versus when you don't. THe phrase says to keep records with identical sort key values in the same relative orde r that they were on the...
You're right Jack. COBOL does not like starting a dataname with a hyphen. My copybook had a dataname such as
:a1:-account-number and when I used the REPLACING string as in my last post, I got a compile error for each dataname that looked like that. It became -account-number.
I work on IBM Enterprise COBOL. Leaving the replacing phrase off does not work. The string :a1: remains in the copybook and causes a compiler error.
I did try a replacing phrase such as
REPLACING ==:a1:== BY ====
and it removed the string.
You're writing a fixed length record.
Let's look at a couple of things. The length code of a variable length record is defined to use 4 bytes. Your COMP PIC S9(04) only takes two bytes. The IBM manual that I have says the length fields are not available to you for reference. You're trying...
It sounds to me like you're writing fixed length records every time. Or else your write statement is always referring to the detail record rather than the header record so every 'variable length' record you write is 250 bytes.
COBOL needs to understand that you have different lengths for different records. One way to do that would be to set up two different 01 levels under the FD.
FD OUTPUT-FILE.
01 HEADER-RECORD PIC X(100).
01 DETAIL-RECORD PIC X(250).
If you have a WRITE...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.