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 are the jcl procedures?

643


I HAVE A VB BLOCK WHICH IS USED AS INPUT IN COBOL CONATINING SOME RECORDS CAN I CHANGE THE FILE FROM VB TO FB?

2097


What is the function of //cntl statement?

828


Explain how can a jobs execution priority be modified?

736


How can the attributes of one sms dataset be copied to another dataset?

848






whats the diff bw the evaluate also and and?

1850


How would you understand error(execution phase)?

621


I want to join to input files and write the matching fields on to an output file but i dont want the output file a sorted one

1927


Explain the function of job statement in jcl?

644


Suppose I have a program in cobol name ”careerride” and want to execute the program by jcl. Specify the process?

668


Is it possible to left uncode disp?

711


How does jcl act on code(if you take a cobol program)?

705


Explain the function of dd disp parameter?

593


which utility is used a dummy utility?

789


what is use of dsn parameter in dd statement?

667