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...

Wrete a JCL to compare two files and mached records move to
onc file & un mached rows wants to another file?

Answer Posted / ashish uplenchwar

ID DIVISION.

PROGRAM-ID. COMP1.

ENVIRONMENT DIVISION.

INPUT-OUTPUT SECTION.

FILE-CONTROL.

SELECT F1 ASSIGN TO DD1

ORGANIZATION IS SEQUENTIAL

ACCESS MODE IS SEQUENTIAL

FILE STATUS FS1.

SELECT F2 ASSIGN TO DD2

ORGANIZATION IS SEQUENTIAL

ACCESS MODE IS SEQUENTIAL

FILE STATUS FS2.

SELECT F3 ASSIGN TO DD3

ORGANIZATION IS SEQUENTIAL

ACCESS MODE IS SEQUENTIAL

FILE STATUS FS3.

SELECT F4 ASSIGN TO DD4

ORGANIZATION IS SEQUENTIAL

ACCESS MODE IS SEQUENTIAL

FILE STATUS FS4.

DATA DIVISION.

FILE SECTION.

FD F1.

01 FILE1.

02 F1EID PIC X(2).

02 FNAME PIC X(5).

02 FILLER PIC X(73).

FD F2.

01 FILE2.

02 F2EID PIC X(2).

02 LNAME PIC X(5).

02 FILLER PIC X(73).

FD F3.

01 FILE3.

02 F3EID PIC X(2).

02 FNAME1 PIC X(5).

02 LNAME1 PIC X(5).

02 FILLER PIC X(68).

FD F4.

01 FILE4.

02 F4EID PIC X(2).

02 FNAME3 PIC X(5).

02 LNAME3 PIC X(5).

02 FILLER PIC X(68).

WORKING-STORAGE SECTION.

77 FS1 PIC 9(2).

77 FS4 PIC 9(2).

77 FS2 PIC 9(2).

77 FS3 PIC 9(2).

01 TABLE1.

02 TAB1 OCCURS 5 TIMES INDEXED BY A1.

03 EID1 PIC X(2).

03 FNAME2 PIC X(5).

01 TABLE2.

02 TAB2 OCCURS 5 TIMES INDEXED BY A2.

03 EID2 PIC X(2).

03 LNAME12 PIC X(5).

PROCEDURE DIVISION.

OPEN INPUT F1.

OPEN INPUT F2.

OPEN OUTPUT F3.

OPEN OUTPUT F4.

PERFORM UNTIL FS1 = 10

READ F1

IF FS1 = 00 THEN

MOVE F1EID TO EID1(A1)

MOVE FNAME TO FNAME2(A1)

END-IF

SET A1 UP BY 1

END-PERFORM.

CLOSE F1.

PERFORM UNTIL FS2 = 10

READ F2

IF FS2 = 00 THEN

MOVE F2EID TO EID2(A2)

MOVE LNAME TO LNAME12(A2)

END-IF

SET A2 UP BY 1

END-PERFORM.

CLOSE F2.

SET A1 TO 1.

OPEN INPUT F2.

PERFORM UNTIL FS2 = 10

SET A1 TO 1

READ F2

IF FS2 = 00 THEN

SEARCH TAB1 AT END PERFORM P1

WHEN EID1(A1) = F2EID PERFORM P2

END-SEARCH

END-IF

END-PERFORM.

SET A2 TO 1.

OPEN INPUT F1.

PERFORM UNTIL FS1 = 10

SET A2 TO 1

READ F1

IF FS1 = 00 THEN

SEARCH TAB2 AT END PERFORM P3

WHEN EID2(A2) = F1EID PERFORM P4

END-SEARCH

END-IF

END-PERFORM.

CLOSE F2 , F3 ,F4.

STOP RUN.

P1.

MOVE FILE2 TO FILE4.

WRITE FILE4.

P2.

MOVE EID1(A1) TO F3EID.

MOVE FNAME2(A1) TO FNAME1.

MOVE LNAME TO LNAME1.

WRITE FILE3.

P3.

MOVE FILE1 TO FILE4.

WRITE FILE4.

P4.

MOVE EID2(A2) TO F3EID.

MOVE FNAME2(A2) TO FNAME1.

MOVE LNAME TO LNAME1.

WRITE FILE3.



Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how you will the direct the data to spool using sysout option?

2355


When you specify multiple datasets in a JOBLIB or STEPLIB, what factor determines the order?

1390


have in 100 records in a file i want to read first 3 records and skip next 3 records and agan i want to read 3 records and again i want to skip 3 records... run a loop from record one to 10 evaluate i/3 if comes even then skip else write to output file

1456


Is their any limit for data sets?

1119


Can an individual step be restricted from using all the jobs allowed cpu time?

1499


What is the difference between the positional and keyword parameters? Give examples.

1187


What is catelog procedure and how many catelog procedure to use in one job?

8551


Describe the various parameters utilized in the creation of a gdg?

1100


How to alter the parameters for the existing gdg?

1137


What is the function of //jcllib statement?

1266


What are the 4 fields in dd statement?

1190


A dd statement consists of 4 fields. Name them?

1375


Explain dfsort utility?

1282


Is condition checking possible in jcl? If yes, how?

1219


what is the use of IEBGENER utility?

1114