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

For what purpose steplib and joblib are used ?

909


In job processing, what happens in conversion stage?

982


Explain about LMFREE�free data set from its association with data ID

1336


Suppose there are 2 Input files Infile-1 and Infile-2. Both the Files contain Employee Records. You need to compare both the files and Write the Common Records in third file named Outfile. How can we do this using File-Aid?

2477


How to code these statements in JCL: CLEANUP INITIAL(NO) RESTART(NO) DYNALLOC(NO) job definition..?

2050


Is there any command to check wether the ps file is in sorted order?

2670


What is jcl in mainframe, and how many types of jcl statements are there for a job?

938


What is the significance of addrspc parameter in exec statement?

989


How to read and write a single record into a file. I would like to use it to enter a single 8-character piece of information and use it to put it into a variable for processing in JCL. Thank you

839


what happens in conversion stage in job processing?

970


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

2344


what is DD statement is used in JCL?

936


How jcl is used for testing batch programs?

1002


How can the submitting users racf authority be overridden in a job stream?

1025


What is the motivation behind coding class parameter in job statement?

929