Solved

Cobol question  regarding release statements

Posted on 2002-06-17
9
235 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
simplest php form 3 85
ejb wildfly example 2 69
Restore Windows 7 Snipping Tool function to Windows 10 10 92
Where to download python requests library 6 61
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
A short article about problems I had with the new location API and permissions in Marshmallow
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

679 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