Solved

Cobol question  regarding release statements

Posted on 2002-06-17
9
231 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
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
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…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
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…

786 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