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 “Cond= even” and “Cond=only”?

740


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.

1986


List the various advantages of using jcl language?

852


What are the jcl procedures?

645


What are steplib and joblib? What for they are used?

695






Define concatenating?

667


What are the 4 fields in dd statement?

744


What is multithreading in jcl?

940


what is SOC4 error?

736


Name the parameters which can be used to limit the number of records written to a sysout dataset?

654


How to pass data to a program that is coded in an exec statement?

825


Is condition checking possible in jcl?

722


Matching Logic in Jcl not in cobol.Could any one please answer this question

3669


How to submit a jcl from cics?

666


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

778