Adding a new Sort workfile in z/OS COBOL sort program



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

Adding a new Sort workfile in z/OS COBOL sort program

Postby ikartik90 » Sat Jan 28, 2012 3:02 pm

I'm a new mainframe developer and wish to create a sort program in COBOL. But unfortunately I don't have a clue of how to add a sorting workfile to the COBOL code in the environment division. Kindly help me find a solution to the same.

The example I tried to go through provided the sort workfile as:
 ENVIRONMENT DIVISION.
              SELECT WORKFILE ASSIGN TO WORK.TMP.


But in case of mainframe where does WORK.TMP reside? I mean we generally use a JCL to call files for input/output. But how can we call WORK.TMP if it is not to be called using a DD statement in the run-time JCL?
ikartik90
 
Posts: 2
Joined: Sat Jan 28, 2012 1:02 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Adding a new Sort workfile in z/OS COBOL sort program

 

Re: Adding a new Sort workfile in z/OS COBOL sort program

Postby BillyBoyo » Sat Jan 28, 2012 3:50 pm

My advice is to code a stand-alone sort to have the files already in sequence for your Cobol program. Keep the sort process simple, keep the program simple.

I've never coded a Cobol file sort for any business purpose. I never intend to, unless for some obscure reason in a horrible existing program, it can't be avoided.

However, I expect the Cobol manuals and trial-and-error will get you there if you insist on continuing. Does your site use DFSORT? If so, see if you can use compiler option FASTSRT. If you use Syncsort, see if it has that available. Check your Sort manual as well, it should be covered.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: Adding a new Sort workfile in z/OS COBOL sort program

Postby ikartik90 » Sat Jan 28, 2012 4:51 pm

I wish to create the COBOL sort program as my menter wants me to.
Secondly, the website I'm referring doesn't put up any kind of JCL code for it is based on stand-alone cobol programming.
ikartik90
 
Posts: 2
Joined: Sat Jan 28, 2012 1:02 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Adding a new Sort workfile in z/OS COBOL sort program

Postby BillyBoyo » Sat Jan 28, 2012 7:31 pm

Well, I searched this forum and found this: ibm-cobol/topic6774.html#p29737

That program, and the topic, may also give you a leg-up, along with the manuals and trial-and-error.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post