Sort process in COBOL/400

530 pts.
Tags:
AS/400
COBOL/400
DB2/400
Hi Group,

I am trying to understand the significance of sorting in COBOL/400.
Sorting is used for arranging records into a specific sequence so that sequential processing can be performed. But, for arranging records in a particular order I can as well create a logical file and process it; Why should I go for Sorting?

Regards,
MVRK


Software/Hardware used:
AS/400, COBOL/400, DB2/400

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 5  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TomLiotta

    Why should I go for Sorting?

    You shouldn't. Who said you should?

    The SORT feature is included for three general reasons.

    First, it can be useful in some limited circumstances. It's not likely you'll ever need it.

    Second, programs that have been migrated to AS/400s might need it. After migration, programs might be updated to take advantage of native DB2 capabilities or, probably even better, to use SQL.

    And third, COBOL standards include the SORT facility at levels supported by AS/400 series systems. Just because a standard includes a feature doesn't mean that you should use it.

    Tom

    125,585 pointsBadges:
    report
  • mvrkrishna
    Thanks for your answer Tom.  I would like to know what are those limited circumstances under which we go for SORT.
    530 pointsBadges:
    report
  • TomLiotta
    When you need some dynamic programmed control over a sorting sequence and you can't use embedded SQL, a COBOL SORT might be useful. I don't have an example because it's not useful enough for anything nowadays. It's an old COBOL feature from days before modern DBMSs were available. It's not worth looking into if you can't think of a reason to use it. -- Tom
    125,585 pointsBadges:
    report
  • mvrkrishna
    Thanks Tom.
    530 pointsBadges:
    report
  • MDratwa
    We use the sort option on our letter printing program (really old program (1994) but it works).  We create a list of customer addresses in a standard input PF (name, addr1, addr2, city, state, zip).  The file is loaded via COBOL program, query, or SQL.  Inside the print program, we load the file into the sort (sort by zip & city/state) and print using a formatted print file front page and an overlay of the form letter on the back. 

    We do not really use sort much nowadays with the options of DB2/SQL.
    785 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following