I had Records in file Like this
Company Code
IBM 2
IBM 1
IBM 4
WIPRO 3
WIPRO 2
WIPRO 9
TCS 4
TCS 6
TCS 3

i want the record of every company with highest code How can
i do that?

Answer Posted / sathish

//STEP1 EXEC PGM=SORT
//SORTIN DD *
IBM 2
IBM 1
IBM 4
WIPRO 3
WIPRO 2
WIPRO 9
TCS 4
TCS 6
TCS 3
//SORTOUT DD DSN=D362967.TEST.PS1,DISP=SHR
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=(1,12,CH,D)
/*
//STEP1 EXEC PGM=SORT
//SORTIN DD DSN=D362967.TEST.PS1,DISP=SHR
//SORTOUT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=(1,5,CH,A)
SUM FIELDS=NONE
/*

Is This Answer Correct ?    6 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the function of the dd avgrec keyword in sms datasets?

828


Explain about ISPF/TSO Commands

1308


What is the significance of addrspc parameter in the exec statement?

613


How do you overcome this limitation ?

688


What is catelog procedure and how many catelog procedure to use in one job?

7430






How can a jobs execution priority be modified?

788


Explain about LMFREE�free data set from its association with data ID

991


Explain dfsort utility?

661


What are the 4 fields in dd statement?

734


What is the function of the steplib dd statement?

731


What do you understand by the term “keyword” with respect to jcl and what is the opposite of the term?

666


which parameter is use to declare the name of dataset in dd statement?

722


What is the function of the dd dcb keyword?

816


what is the purpose of coding class parameter in job statement?

709


What is the significance of addrspc parameter in exec statement?

724