Solved

Cobol question  regarding release statements

Posted on 2002-06-17
9
234 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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
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
 
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

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
groupNoAdj 7 105
When i run adoquery my application freezes 26 179
Not needed 13 119
youtube blocking politics 4 56
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…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
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…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

828 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