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

Mainframes gets a text file that contains the name of the file. Now using JCL i want to locate that file name in the mainframe system and perform further processing. Please tell how to proceed

2515


State the uses of syspring, sysin, sort fields, sum fields and dummy.

1029


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

8572


which parameter is used to check the syntax of a jcl without executing it?

1315


what is DSN parameter and DISP parameter is used for?

1109


how can the same proc be re-used and called by many jobs?

1448


What statement marks the beginning of an in-stream or cataloged procedure in jcl and assigns default values to parameters defined in the procedure?

1255


How to alter the parameters for the existing gdg?

1148


How to run cobol program using jcl?

1171


Are there any set of rules for the names of the steps used in a job?

1059


what sort card you will use to copy the data from one dataset to another dataset?

1154


How to execute 2nd and 4th steps among 5 steps in jcl proc?

1232


What is the maximum length of a single line of jcl?

1295


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

1098


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

1141