"YOU AND THE ART OF ONLINE DATING" is the only product on the market that will take you step-by-step through the process of online dating, provide you with the resources to help ensure success. Get it now!
You are never moving the data you read from BASEBALL-2. SEQ into the record used to write BASEBALL-2. RPT You can do something like WRITE THE HEADER INFO MOVE HEADING-LINE-1 TO BASEBALL-RECORD-OUT WRITE BASEBALL-RECORD-OUT Or WRITE BASEBALL-RECORD-OUT FROM HEADING-LINE-1 Similarly you can write the details line WRITE THE DETAIL MOVE DETAIL-LINE TO BASEBALL-RECORD-OUT WRITE BASEBALL-RECORD-OUT.
You are never moving the data you read from BASEBALL-2. SEQ into the record used to write BASEBALL-2.RPT. You can do something like * WRITE THE HEADER INFO MOVE HEADING-LINE-1 TO BASEBALL-RECORD-OUT WRITE BASEBALL-RECORD-OUT Or WRITE BASEBALL-RECORD-OUT FROM HEADING-LINE-1 Similarly you can write the details line * WRITE THE DETAIL MOVE DETAIL-LINE TO BASEBALL-RECORD-OUT WRITE BASEBALL-RECORD-OUT.
I see there are two paragraphs which are not executed in the code starting 300- and 400- as they are not performed and are below the stop run. There may be i-o-control entries omitted for the output to the file and the output appears to be written to a file and not to a display screen or printer. This would depend any default settings or those of any external assignments or redirects.
Several different patterns may be used when coding COBOL I/O operations. I see two distinct patterns in your program. Pattern 1: Define I/O record layouts under the FD entry.
You have done this for your input file. BASEBALL-RECORD-IN serves as both a file I/O buffer and a full record description. Pattern 2: Define a dummy FD record buffer then create additional detail record definitions under Working Storage.
You did this for your output record. BASEBALL-RECORD-OUT is just an I/O buffer and the detail record layouts are defend under Working Strorage using three different record layouts: HEADING-LINE-1, HEADING-LINE-1 and DETAIL-LINE. What is the difference?
The primary differences relate to when each of these records becomes addressable and how you read/write data. When using Pattern 1, only a single record buffer is allocated. This is the record associated with the file's FD clause.In your case this is the 36 byte BASEBALL-RECORD-IN record.
This buffer may not be addressable until after the file it is associated with has been OPENed. Attempting to access this record buffer (by explicitly initializing it, moving spaces to it or any other reference) would cause a run-time error (crash and burn). After the open and READ, data are available in the record buffer associated with the FD.
Since this FD has a defined record structure, you may reference any of the fields in it (e.g. NAME-IN) immediately after issuing a READ statement. When using Pattern 2, Separate record structures are declared in Working Storage. Here the records HEADING-LINE-1, HEADING-LINE-2 and DETAIL-LINE are all addressable when the program starts running - even though the output record buffer BASEBALL-RECORD-OUT (associated with the FD) will not be addressable until after the output file has been opened.
The thing to remember here is that there is no "automatic" connection between the record buffer BASEBALL-RECORD-OUT and the Working storage records HEADING-LINE-1, HEADING-LINE-2 and DETAIL-LINE - you have to explicitly MOVE the data from Working Storage to the record buffer using something like: MOVE HEADING-LINE-1 TO BASEBALL-RECORD-OUT WRITE BASEBALL-RECORD-OUT before each and every WRITE operation. Alternatively you could write from the Working Storage record as in: WRITE BASEBALL-RECORD-OUT FROM HEADING-LINE-1 This is just a sugar coated way of doing the MOVE/WRITE illustrated above. This explanation should make it clear to you why the READ puts data directly into a fully fielded record structure for reference, but WRITE requires an additional MOVE of some sort.
These are two I/O patterns available in COBOL.As you learn more about the language quite a few additional patterns should come to light as well.
You have to move HEADING-LINE-1, HEADING-LINE-2, and DETAIL-LINE to BASEBALL-RECORD-OUT before you WRITE BASEBALL-RECORD-OUT.
It's been a while since I touched Cobol but you are probably missing updating BASEBALL-RECORD-OUT.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.