How I sort the records in a file and copy the first 10
records to another file

Answer Posted / kk

hi,

Using dfsort

//step10 exec pgm=sort
//sirtin dd dsn=userid.qulifier.psname,disp=shr
//sortout dd dsn=userid.qulifier.psname,disp=shr

sort fields=(starting position,length,cha,asc/dsc)
stopaft=10

now u get result sortout ps.

Is This Answer Correct ?    23 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain dfsort utility?

856


what happens when COND is coded in JOB statement and when COND is coded inside EXEC statement?

886


What are hierarchy levels in jcl?

1081


Suppose I have five jobs to do. But I want to hold one?

750


Is condition checking possible in jcl? If yes, how?

843






What parameter directs the output of the job log dataset?

864


What do we mean by 'Virtual storage' for a dataset and for a JOBSTEP ? What is the significance of the following statement for a programmer 'Virtual storage results in program addresses being independent of the addresses that actually exist in a computer' ?

1663


I have a cobol db2 program(PGM A) where other program (PGM B) will call this program and passes some 50 fields data to PGM A. PGM A has some layout in which it receives the data from PGM B. And this layout has been copied in the linkage section pf PGM A. After getting the data, PGM A writes the data in a flat file in the same layout which it receives from PGM B. PGM B is a simple COBOL pgm. Please provide a JCL to run these programs.

1816


what are the statements that are not valid to be included in an include statement?

925


List the different components of jcl statement?

783


What is notcat 2 - gs?

1056


What is the job entry system used in your project? based on what criteria the sequence of jobs are picked if priority is not mentioned in the job card?

1892


What are the 2 types of parameters in dd statement?

730


Is their any set of rules for dd? Explain.

754


Explain the function of //jcllib statement?

818