We have two PS files,want to compare those files and put
the duplicate records in one file.
Input file 1 contains(1,2,4,9,10)
Input file 2 contains (1,4,5,11,12,14,16).

Help me with jcl.

Answer Posted / nitika

Use SORTXSUM utility in JCL to get the output.
//JOB1 JOB ,, CLASS = A
//STEP1 EXEC PGM=SORT
//SORTIN DD DSN=TEST.PS.INPUT
//SORTOUT DD DSN=TEST.PS.OUTPUT
//SORTXSUM DD DSN=TEST.PS.OUTPUT
//SYSIN DD *
SORT FIELDS = (1,1,CH,A)
SUM FIELDS = (NONE,XSUM)
/*

Now SUM FIELDS = NONE means no duplicates in the output file
(TEST.PS.OUTPUT)and XSUM means duplicates, in the two files
being matched, should be sent to the file mentioned in
SORTXSUM ddname.

So, output file will have 1,4.

Is This Answer Correct ?    3 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between run mode and addressing mode?

631


Why block size is multiple of lrecl in jcl?

908


Does jcl support automatic restart?

761


Explain the jcl exec statement?

646


What do you know about jcl?

647






What dd statement is used to supply the name of a dataset?

774


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

859


What do you understand by the terms: joblib and steplib?

626


What is the purpose of dd * statement in jcl?

799


Is it possible to left uncode disp?

711


what is use of dcb parameter in dd statement?

771


What do you understand by the term “keyword” with respect to jcl and what is the opposite of the term?

677


Which dd parameters are required?

688


How can an in-stream dataset be terminated?

846


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

718