How do you define a sort file in JCL that runs the COBOL
program?

Answer Posted / shinoy sansilavose

Suppose if you want to sort a file TEST.OUTPUT.FILE which
is the output of your COBOL program then you can do the
following coding in JCL,

//SORTIN DD DSN=TEST.OUTPUT.FILE,DISP=SHR
//SORTOUT DD DSN=TEST.OUTPUT.SORT.FILE,
// DISP=(NEW,CATLG,DELETE),
// UNIT=TESTDA,
// SPACE=(CYL,(50,50)),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=0)
//SYSIN DD *
SORT FIELDS=(1,5,CH,A)

Now the sorted file TEST.OUTPUT.SORT.FILE will be sorted
based on the field starting from 1 to 5 specified in the
input for SORT.

Is This Answer Correct ?    30 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain how will you differentiate between an internal and an external sort, the pros and cons, internal sort syntax etc

825


Which Search verb is equivalent to PERFORM…VARYING?

687


What is the difference between structured cobol programming and object alternativelyiented cobol programming?

711


Why occurs cannot be used in 01 level in COBOL?

719


How to use the same COBOL program in Batch and CICS on lines? explain with an example

1914






Explain how you can characterize tables in cobol?

640


Explain sorting techniques in cobol program? Provide the sort file definition, the sort statement, its syntax and meaning

686


What is a scope terminator give example?

659


Mention the guidelines to write a structured cobol program?

620


what is difference bt COND, REGION & TIME parameters at JOB & EXEC. give an exp.

8167


) what is the difference between AID and HANDLE AID?

1637


How do you reference the following file formats from cobol programs?

696


How arrays can be defined in COBOL?

665


What is the use of intialize verb?

751


What are the different rules of SORT operation?

701