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

For rewrite, why is it mandatory that file needs to be opened?

620


what is amode(24), amode(31), rmode(24) and rmode(any)?

690


How can you get the ksds file records into your cobol program?

639


if we have " ibm mainframe ",in that how to remove first and last leading space eg:"ibm mainframe" like that the answer we need

851


How can we find that module can be called – whether DYNAMICALLY or STATICALLY?

708






What is the difference between external and global variables in COBOL?

811


How to find out the closest prime number of an input number? I believe it has something to do with SEARCH and COBOL Linear Array.

3713


explain sorting techniques in cobol program?

686


Write down the divisions of cobol program?

665


Write the code to count the sum of n natural numbers.

697


What are literals?

626


How many sections are there in data division in COBOL?

676


Name some of the examples of COBOl 11?

2676


Hi pls anybody tell me about " ANALYSIS DOCUMENT PREPARATION AND ESTIMATION OF TASK " (in real time project)."I want to update a sequential file in my project" for that purpose i need both structures i mean analysis document and estimation of task.

1697


Our issue is there seems to be a disconnect, or no link, between our SELECT statement and our SD. We had SELECT SORT-FILE and SELECT SORT-FILE ASSIGN TO SORTWRK. ASSIGN TO SORTWRK1 SORTWRK2 SORTWRK3 SORTWRK4. with SD SORT_FILE RECORD CONTAINS 7833 CHARACTERS. In either case, at run time, the system ignored our SORTWRK# DD statements and allocated 16 sort works with the SORTWK## naming convention. Any ideas why the system does not recognize the connection? We do not even need the SORTWRK DD statements. Thanks

2331