i have two file, each file having :

file1 is having 2 fields

field1 field2



file2 is having 3 fields
field1 field2 field3


my req is to make it one file like:

field1 field2 field1 field2 field3

if anyone know please send me syntax, i tried this with
DFSORT but could not succeed.

Answer Posted / visitor

FD FILE1
01 FILE1-REC
05 FIELD1 PIC X(3)
05 FIELD2 PIC X(3)

FD FILE2
01 FILE2-REC
05 FIELD1 PIC X(3)
05 FIELD2 PIC X(3)
05 FIELD3 PIC X(3)

FD FILE3
01 FILE3-REC
05 FELD1 PIC X(3)
05 FELD2 PIC X(3)
05 FELD1 PIC X(3)
05 FELD2 PIC X(3)
05 FELD3 PIC X(3)

PROCEDURE DIVISION
oPEN INPUT FILE1
FILE2
OUTPUT FILE3

READ FILE1
READ FILE2

WRITE FILE3-REC FROM FILE1-REC,FILE2-REC.

STOP RUN.

Is This Answer Correct ?    6 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the different rules of SORT operation?

689


What is the Purpose of POINTER Phrase in STRING command in COBOL?

711


What are the cobol coding sheets?

657


) how do u code after getting data?

1578


Why would you use find and get rather than to obtain?

677






I have one ps file in which there are 3 fileds emp_no,emp_name and leave_app.this ps file information give the detail of employee which is going to apply for leave.suppose emp_no=113430,emp_name=ajay,leave_app=1 that means he is going to apply for 1 day leave.and accordingling the table in db2 will be updated means if he has that no of leave in his account then he will get dat leave and updated acc. in table(leave_balance=previous leave present in table-leave_app).Now i want to check whther the updated result is correct or not by comparing the two ps file using IEBCOMPARE or icetool so what is going to be the two ps file and how its is going to be compare.

1999


How do get the result of your program directly on your pc?

1874


Can we redefine the field of x(200) to less than 200?

814


how can we apply for HSBC exam(Mainframe) in India??? i went to their site and was told to submit my CV ,. etc..( totally confusing...)

1916


i want a program using by if, evaluate , string, unstring, perform, occurs?

4039


How to remove 2 duplicate records and copy only one using job control language?

732


Write a program to enter and display the names of students in a class using the occurs clause.

645


what is s000 u4087 error? please give the all error codes in cobol,jcl.

17024


What is the compute verb? How is it used?

651


What are the rules of the move verb?

695