Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

File1 has 100 records and file2 has 200 records i want to
copy 50 records which r in both file into file3

Answer Posted / madhavi chava

This can be coded as given below

//SORT1 EXEC PGM=SORT
//SORTJNF1 DD *
00000111111 000001234567 LOCAL =====
00000333333 000003456789 LOCAL =====
00000555555 000005678901 EXTRN =====
00000666666 000006789012 EXTRN =====
00000777777 000007890123 LOCAL =====
//SORTJNF2 DD *
00000222222 000002345678 ===== BCDEF
00000444444 000004567890 =====
DEFGH
00000666666 000006789012 ===== FGHIJ
00000888888 000008901234 ===== HIJKL
00000999999 000009012345 ===== JKLMN
//SORTOUT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
JOINKEYS FILES=F1,FIELDS=(1,11,A,13,12,A)
JOINKEYS FILES=F2,FIELDS=(1,11,A,13,12,A)
REFORMAT FIELDS=(F1:1,31,F2:32,5)
SORT FIELDS=COPY

output of the file3
00000666666 000006789012 EXTRN FGHIJ

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which dd parameters are required?

1114


How to run cobol program using jcl?

1157


what is use of space parameter in dd statement?

1215


What are the rules employed while naming the steps in a job?

1092


Many jcl statements contain specific values designed to direct and control the execution of the statement. What are these fields called?

1169


What is the syntax of JCL statement?

1160


How can unused space allocation be returned to the system when a dataset is closed?

1409


what is the use of JCL?

1109


a dd statement has 2 types of parameters. Name them?

1090


what is the use of IEBGENER utility?

1115


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

1216


What parameter directs the output of the job log dataset?

1214


Explain the job statement in jcl?

1112


In job processing, what happens in conversion stage?

1146


How jcl is used for testing batch programs?

1221