Solved

Cobol question  regarding release statements

Posted on 2002-06-17
9
225 Views
Last Modified: 2010-04-17
I'm looking at an old program that our company uses.  I've never programmed in COBOL before so this is a very complicated project for me.  Anyway, the program creates a report using the report writer (as I understand).  I've been looking at some of the variables in the program and it seems like some of the variables receive values many times.  For instance, in the program a variable called sort-amount receives data from a data file field called arh-invoice-amount.  Then, the same exact variable receives another value in another procedure.  It doesn't look like sort-amount did anything with the first value it received.  The thing that I noticed is that there is a release statement before the start of the procedure in which the sort-amount receives the second value.   Does that release statement tell the program where to dump the value that sort-amount received?  Again, I'm really new to this language so please explain things thoroughly.

Please let me know if I need to clarify anything.

Thanks in advance,
boody
0
Comment
Question by:boody
  • 5
  • 3
9 Comments
 
LVL 54

Expert Comment

by:nico5038
ID: 7084397
Long time ago for me, but as far as I recall the sort in the reporter is done in two phases:
1) Pre-sort, reads all records into a temp file.
   The code can be used to "prepare" some fields or even combine different files.
2) After-sort, processes all sorted records from the temp (sort) file.

The release statement will trigger COBOL to start the sort of the temp file.

Does the code make more sense now ?

Nic;o)
0
 
LVL 53

Accepted Solution

by:
COBOLdinosaur earned 100 total points
ID: 7100912
RELEASE is the same as WRITE except that the write is to the sort work files.

This is probably in a sort input procedure.  The normal sequence for a program using report write is Extract, Sort, and then generate the report using the records returned form the sort files.

The extract is almost always as sort input procedure.  The extracted data is sent to the sort work files with the release.  The report generation is generally a sort output procedure, though it could also be in line.  The sort procedure would normally get the data back from the sort work files with RETURN which is the same as READ exceptit reads the sort work files.

The output procedure will then populate the report record layouts, for of the formatting is defined in FD of the report file.

I hope that helps.  If you need more, it would be helpful to know what platform you are on, and what compiler you are using.

Cd&
0
 
LVL 54

Expert Comment

by:nico5038
ID: 7101085
Hi Cd&,

Sure about the FD, wasn't that for the sort file a SD ?

Nic;o)
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 7101124
SD is for sort files.  Report writer uses a regular FD but includes options like LINAGE and FOOTING.

The report is a regular spooled file, though is it could also go to disk.  Sort work files are generally shared pool areas on disk.

Cd&
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 7109251
boody,

Where are we at with this?  has any of this helped?

Cd&
0
 
LVL 54

Expert Comment

by:nico5038
ID: 7515212

No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
 - Answered by: COBOLdinosaur
Please leave any comments here within the
next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

Nic;o)
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 7515353
:^)
0
 

Expert Comment

by:Jgould
ID: 7548202
Question has been closed as per recommendation

JGould-EE Moderator
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 7548274
Thanks JG and Nico. :^)

Cd&
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

I know it’s not a new topic to discuss and it has lots of online contents already available over the net. But Then I thought it would be useful to this site’s visitors and can have online repository on vim most commonly used commands. This post h…
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now