logo

CuriousTab

CuriousTab

Discussion


Home Interview Technology Comments

  • Question
  • How do you sort in a COBOL program? Give sort file definition, sort statement syntax and meaning.


  • Correct Answer
  • Syntax: SORT file-1 ON ASCENDING/DESCENDING KEY key USING file-2 GIVING file-3 USING can be substituted by INPUT PROCEDURE IS para-1 THRU para-2 GIVING can be substituted by OUTPUT PROCEDURE IS para-1 THRU para-2 file-1 is the sort workfile and must be described using SD entry in FILE SECTION file-2 is the input file for the SORT and must be described using an FD entry in FILE SECTION and SELECT clause in FILE CONTROL file-3 is the outfile from the SORT and must be described using an FD entry in FILE SECTION and SELECT clause in FILE CONTROL file-1, file-2 & file-3 should not be opened explicitly INPUT PROCEDURE is executed before the sort and records must be RELEASEd to the sort work file from the input procedure OUTPUT PROCEDURE is executed after all records have been sorted Records from the sort work file must be RETURNed one at a time to the output procedure 


  • Technology problems


    Search Results


    • 1. What are different file OPEN modes available in COBOL?
    • Discuss
    • 2. How do you define a sort file in JCL that runs the COBOL program?
    • Discuss
    • 3. Specify the CICS command used to read a VSAM record starting with prefix F. Code all the relevant options?
    • Discuss
    • 4. The EIB field which gives the last CICS command executed is?
    • Discuss
    • 5. What CICS command do you need to obtain the user logon-id?
    • Discuss
    • 6. What are the steps you go through while creating a COBOL program executable?
    • Discuss
    • 7. In the JCL, how do you define the files referred to in a subroutine ?
    • Discuss
    • 8. What COBOL construct is the COBOL II EVALUATE meant to replace?
    • Discuss
    • 9. What divisions, sections and paragraphs are mandatory for a COBOL program?
    • Discuss
    • 10. What are the differences between COBOL and COBOL II?
    • Discuss


    Comments

    There are no comments.

Enter a new Comment