× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.




Badly phrased question. See:
http://www.tuxedo.org/%7Eesr/faqs/smart-questions.html

More information follows:

On 06/06/2008, at 7:22 AM, Robert Munday wrote:

I need to sort a table by one of its elements which should be easy enough. There are no experienced COBOL programmers in this shop and my only book example is non-iSeries. SEU is hanging up on my sort statement.

Here is what I have:

01 SL415-CB-Work-Table.
04 CB-Table-Ctr Pic 99 Value Zero.
04 CB-Work-Table-Entry
Occurs 50
Ascending Key Is CB-Past-Due
Indexed By CB-Index.
06 CB-Past-Due Pic X(3).
06 CB-SSN Pic X(9).
06 CB-Ln-Num Pic XX.
06 CB-Account-Status Pic XX.

The editor chokes on this:

Sort CB-Work-Table-Entry On Ascending Key CB-Index.

"chokes"? Such a brilliant technical description of the problem. How do you expect an answer when you haven't described the problem? I presume you mean SEU complains about the syntax. Perhaps: LNC1447 - Statement incomplete; last valid item found before '.'. Statement ignored.

From COBOL Language Refeerence:

"SORT Statement
The SORT statement accepts records from one or more files, sorts them according
to the specified key(s), and makes the sorted records available either through an
OUTPUT PROCEDURE or in an output file."

Does this description fit with what you are trying to do?


What to do? I'd buy an iSeries COBOL book

Why buy one? You've got access to perfectly good reference material in the COBOL Programmer's Guide and COBOL Language Reference both freely down-loadable from the Information Centre.

but I'm outahere at the end of the month. I could also do this in SQL if I knew how.


Presuming you can sort the incoming data before it reaches working storage then the Database Programming manual will show you how to use embedded SQL in COBOL.

Otherwise you could use the Sort APIs. See the API section of the Information Centre. There is also an article on System i Network about using the Sort APIs in COBOL.

Regards,
Simon Coulter.
--------------------------------------------------------------------
FlyByNight Software OS/400, i5/OS Technical Specialists

http://www.flybynight.com.au/
Phone: +61 2 6657 8251 Mobile: +61 0411 091 400 /"\
Fax: +61 2 6657 8251 \ /
X
ASCII Ribbon campaign against HTML E-Mail / \
--------------------------------------------------------------------




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.