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
how to convert the recors form vsam file to db2 table tru file aid
What is the difference between PIC 9.99 and 9v99 in COBOL?
Is it possible that the redefines clause has different picture clauses compared to the one it redefined?
if we display var1 then what will b displayed in below condition. 77 var1 pic s9(2) value -10. 77 var1 pic s9(2) value -11. " " " -12. " " " -13. -14 ... ... -19.
I have to write to a outfile where the number of records in that file should be the header of that file using IMS.. can anyone help me in this issue
A table has two indexes defined. Which one will be used by the SEARCH?
Explain the configuration section of a cobol program with examples of syntax.
How to fetch 1000 error records from VSAM file(Eg: 1000000 records present) while getting SOC7 abend ?
i need a small 3d program using inline and outline.
how do you define single dimensional array and multidimensional array in your cobol?
How many sections are there in data division in COBOL?
Which is the default, TEST BEFORE or TEST AFTER for a PERFORM statement?
What are the different data types in cobol?
here is my requirement A1 is alphanumeric with value 'A1B2C3D4' as defined below 05 A1 PIC X(8) VALUE IS 'A1B2C3D4' but i need to have A2,A3 as ABCD & 1234 repectively...... A2 = ABCD A3 = 1234 Can you please explain me what are the different ways to do it?
What is inspect in cobol ?