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?

Answers were Sorted based on User's Feedback



I had Records in file Like this Company Code IBM 2 IBM 1 IBM 4 WIPR..

Answer / 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

I had Records in file Like this Company Code IBM 2 IBM 1 IBM 4 WIPR..

Answer / ram

SORT FIELDS=(2,5,CH,D)
DUPKEYS MAX=(13,1,ZD)

Is This Answer Correct ?    1 Yes 0 No

I had Records in file Like this Company Code IBM 2 IBM 1 IBM 4 WIPR..

Answer / sk

Sort the file in decrement order , the key of sort is
Company name and company code, and also use SUM FIELDS =
NONE , then it will remove the duplicates also

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More JCL Interview Questions

How many types of parameters are used in JCL and what are mandatory parameters of JOB statement.

13 Answers   IBM,


what is full form of AIX

3 Answers   Accenture,


What is the improvement to COND= in the latest version of MVS?

3 Answers  


How to use COND Parameter in jcl

4 Answers   NIIT, Wipro,


whats the difference between empty and noempty of GDG?

4 Answers   Patni,






How much space OS allocates when you create a PS or PDS?

4 Answers  


What is the difference between the JOBLIB and the STEPLIB statements?

3 Answers  


i have a jcl containing header body and trailer .in header i have viswa body 2 6 1 9 7 trailer reddy .now i need to sort only body in either asecending or descending order how can i do it

1 Answers   L&T,


How do You skip a Step In JCL?

9 Answers   HTC,


what is the general use of PARM? Give an explanation about the system defined parameters that could be passed through this PARM like XREF,LIST,LET,APOST,RENT etc..

3 Answers   Cognizant,


what is DSN in JCL and what are the parameters to declare the DSN?

0 Answers  


In job processing, what happens in conversion stage?

0 Answers  


Categories