How to exclude the duplicate records from two concateded
flat files (records from both files must be removed)?



How to exclude the duplicate records from two concateded flat files (records from both files must ..

Answer / mayank

We can use SORT to exclude the duplicate
SORT FIELDS=NONE remove the dup from fileC

//STEP1 PGM=SORT
//*** concatinated input files
//SORTIN DD DSN=FILEA,DISP=SHR
// DD DSN=FILEB,DISP=SHR
//** output file contains records except for duplicate
//SORTOUT DD DSN=FILEC,
// DISP=(NEW,CATLG,DELETE),
// VOL=SYSDA,
// SPACES=(CYL(1,1),RLSE),
// DCB=(LRECL=80,RECFMT=F,BLKSIZE=0)
//** give the sort parameter in below sysin
//SYSIN *
SORT FIELDS=(start postion of rec, length of
rec,attribute, A/D)
SUM FIELDS=NONE

Is This Answer Correct ?    7 Yes 2 No

Post New Answer

More JCL Interview Questions

i want to see the jobs in skeleton queue in diff region. (eg. 7 regions are running means , i want to see all the jobs in 7 regions which are in skel queue using 1 command)

1 Answers  


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.

0 Answers  


shall we concordinate two different length dataset in to a new date set.

6 Answers  


My Question is 1. How to cound no. of records in JCL. Please explain with an example. 2. How to execute only odd steps in JCL? I know EDIT TYPE = Inculde, Step Name = 1,3,5 and COND code for all even step. Anyone knows other than this.

0 Answers  


When will we need to specify Space parameter ?

3 Answers   Wipro,






how to solve u4038 abbend?........

3 Answers   Atos Origin, TCS,


As PARM can supply information to a program ? Can PARM be used to supply information to a cataloged or Inline Procedure also ?

2 Answers   IBM, RS Software,


When The Define Jcl Is Not Available, How Can You Get Information About A Vsam File's Organisation ?

0 Answers   IBM,


Please go thru the below points and let me know how to code this. 1. Sort the input dataset for the condition : Starting position is 37,length of the field is 13 based on character and in the ascending order , starting from position 25 length of 12 ,character and in the ascending order. Use a temporary dataset to hold the sorted file. 2. Use the temporary file created in the above step as the input for the next step. The next step is to execute a program and produce an output file. Use the temporary file created in the above as work file 1 and the output of the file to be created in this step work file 2.Also, pass a parameter to the program that is to be executed in this step. The parameter should have the current date in YYYYMMDD format. For the sake of convenience, you can use the below Job Name : Sample1 Input DSN : PCABDT11.CABD.TEST.INPUT Temporary DSN : Sort1 Output DSN : PCABDT11.CABD.TEST.OUTPUT Program Name : SAMPLE Thanks in Advance for your response.

2 Answers  


Hi, I have a requirement File A : I have 6 records out of which 4 are same. File B: I have 8 records out of 6 records are same. The 4 records in FILEA and 6 records in FILE B are same. If we substract we will get two records, I need these two records in output file This is because to remove the duplicates from the database. Through easytrieve we can compare but for that there should not duplicates, but in my file I have duplicates. Thanks in advance!!

2 Answers  


after submiting the jcl.how do you know that the job has been completed.

4 Answers   ACS,


How do you pass parameters to the program as the job is being executed ?

2 Answers  


Categories