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
What is the difference between Global and External Variables?
How do define dynamic array in cobol.
What the difference is between continue and next sentence?
Which division and paragraphs are mandatory for a COBOL program?
How do you differentiate between cobol and cobol-ii?
INREC AND OUTREC? HOW TO SPLIT 5K RECORDS TO DIFFERENT FILES IN A FILE IN COBOL? RESTART IN COBOL-DB2? ISOLATION LEVELS?
Program A (Normal COBBAT) calling a B Program (DB2COBOL, COBBATDB which is using a VSAM file. its a dynamic call. How we will handle VSAM file decleration in our from JCL from where we are running A PGM. And should we have PLAN for A pGM also. if possible can some one post a sample JCL. Thanks for help in advance.
How to traceback if I am getting SOC7 or SOC4 abend? List down the steps
Name the divisions, which are available in a cobol program?
how do you reference the variable block file formats from cobol programs
How you can characterize tables in cobol?
How do you define a variable of comp-1 and comp-2?
if we have " ibm mainframe ",in that how to remove first and last leading space eg:"ibm mainframe" like that the answer we need
How do u write test cases?
Write a program that uses move corresponding.