Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

what is a cataloged procedure ?

1 Answers   Xansa,


I have 15 flat files. each record in the files have the monthly salary for 12 months with the employee number. Now I want to concatenate the 15 files such that for the employee numbers that are common the o/p file should have only one record and the salaries should be concatenated to that record. How can we do it with JCL?

1 Answers  


Suppose I have seven jobs to do, but I want to hold one than how can I do this?

1 Answers  


What is Uncatalog dataset? How can we access/use them?

1 Answers  


How do you override a specific DDNAME/SYSIN in PROC from a JCL?

6 Answers   CTS,


What are the utility programs in jcl?

0 Answers  


How to print the Output to SPOOL using MSGCLASS and SYSOUT ?

4 Answers   IBM,


Can we delete the data using IEFBR14 , IEBGENER??

5 Answers   Kanbay,


How do you restart a PROC from a particular step?

5 Answers  


How to test thru JCL if any file(PS or VSAM) is empty or not. I do not want to use any COBOL prog or Ezytrieve and want to do using utility.

10 Answers   Lehman Brothers,


i have five step in jcl.my forth step is gdg.gdg was abend.when will job complete,hoe to handle you

3 Answers   L&T, Wipro,


01 GROUP-ITEM 05 AMOUNT-1 PIC 99V9 USAGE COMP VALUE 50 05 AMOUNT-2 PIC 9(4)V99 USAGE COMP MOVE ZERO TO GROUP-ITEM ADD 50 TO AMOUNT-1 what will be the content of AMOUNT-1? a.50 b.100 c.0 d.unpredictable

1 Answers  


Categories