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

i need some shortcuts and tso commands can any on ehelp me in these ?

1 Answers  


How system will identify whether user wants to create PS or PDS? If answer is SPACE parameter then why we need to pass ps or po as dataset organisation while creation

1 Answers  


How can a stopped job be started again?

0 Answers  


How to execute only th 15th step of JCL consisting of 50 steps?

12 Answers   Bank Of America,


a set statement is used to define commonly used symbolic across job steps or procedures. It initializes the previous values in the symbolic names. It has to be defined before the first use of the symbolic names in the jcl. State whether true or false?

0 Answers   IBM,






//S10 EXEC PGM=ICETOOL //TOOLMSG DD SYSOUT=* //DFSMSG DD SYSOUT=* //CON DD DSN=VAR.INPUT1,DISP=SHR // DD DSN=VAR.INPUT2,DISP=SHR //OUT DD DSN=VAR.OUTPUT,DISP=(NEW,CATLG,DELETE), // SPACE=(CYL,(5,5)),UNIT=SYSDA //TOOLIN DD * * Splice the needed data from the two VB files together SPLICE FROM(CON) TO(OUT) ON(5,5,CH) WITHALL - WITH(12,5) WITH(22,20) VLENMAX /*

0 Answers  


In sms datasets, what is the function of the dd mgmtclas keyword?

0 Answers  


What is the purpose of dd * statement in jcl?

0 Answers  


What does the one advantange of using IEBUPDTE?????

2 Answers  


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

13 Answers   IBM,


wht happens if blksize = 0 and lrec = 0 ?

1 Answers   TCS,


we define the array like this 01 array 02 veg occurs 10 times 03 days occurs 6 times 04 cost pic 9(5). but why don't we write it as 01 array 02 veg occurs 10 times 03 days occurs 6 time 04 cost pic 9(5). is there any error will occur ,what is it? and why don't 01,02,03 not contain picture clause? if we put pic in those is there any error will occur what is it will occur?

1 Answers   Fidelity,


Categories