I have two input files
i/p1
name id-key flag date
i/p 2
name id-key date

if id-key matches in the both the files then it should
write the output file from i/p1 with flag 'Y'. It should be
done thru JCL sort card ,Please provide the info on this.

---Note : output file should have all records from i/p1
with proper Flag.

Answer Posted / vivek chandrasekaran

Give the two input files to be compared as
//SORTIN DD DSN=INPUT1,DISP=SHR
// DD DSN=INPUT2,DISP=SHR
//SORTOUT DD DSN=OUTPUT,DISP=...
//SORTXSUM DD DSN=MATCH,DISP=(NEW,CATLG,DELETE),..
//SYSIN DD *
SORT FIELDS=(11,5,CH,A),EQUALS
SUM FIELDS=NONE,XSUM

Considering name length 10 and key length 5 starting from
11 pos. XSUM will capture the duplicates. EQUALS will keep
the first duplicate record. To put 'Y' flag use OUTREC
FIELDS=(1:1,15,16:C'Y',17:17,8) considering date length 8
starting from 17 pos.



SUM FIELDS=NONE

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the function of job statement in jcl?

843


I have mainpgm(abc) this is the only cobol pgm(non-db2).And this pgm calling subpgm name "acd" this also only cobol(non- Db)and this pgm calling some other subpgm this pgm has cobol-db2 pgm. 1) IF you calling static mode how to run and how to compile? 2) IF you calling dynamic mode how to run and how to compile? plz suggestion me.

2279


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

885


What are the parameter we cannot use in procedure? How many instream we can write in single jcl?

793


What is the function of the steplib dd statement?

938


What is timing concept in mainframe?

1918


When space is allocated for an output dataset, what units can be used?

1002


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

1005


List the different components of jcl statement?

880


What happens if both JOBLIB & STEPLIB is specified ?

835


Explain about LMQUERY�give a dialog information about a data set

1117


What are s0c1, s0c4, s0c5, s0c7 and socb?

948


Explain about ISPF/TSO Commands

1593


Explain how can an in-stream dataset be terminated?

969


Are there any set of rules for the names of the steps used in a job?

866