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
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 |
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 |
mainframe questions like basic&depth
Where & How Do You Code Identifier In Jcl?
Hi, can we call catalog( say myproc } proc n times in jcl if so how please explain Thanks in advance
what is a null indicator in db2?
When cursor is not closed what is the error?
Explain the purpose of dd * statement in jcl?
When The Define Jcl Is Not Available, How Can You Get Information About A Vsam File's Organisation ?
How to submit multiple jobs. These jobs are members in PDS. The second job should run if the first job runs successfully and so on.
How to DEBUG a JCL?
I have many files which i am receiving from client everyday. I have one step for every file to check for empty or not. Here client gives 30 files i need to check for every file for empty or not and i need to perform 30 steps. Can I do it in single step. Dynamically i need to change the File name in my step.
Explain about Internal Sort
While using SORT FILES =NONE,XSUM I am getting error "ICE172A E XSUM IS NOT SUPPORTED - USE ICETOOL SELECT IF APPROPRIATE"..I want to write duplicate records a a serparte file..how i can do tht?