Read filea And file b write the same records in both files?
Records in a but not in b record in b but not in a
Answers were Sorted based on User's Feedback
Answer / ram g
we can achieve this through jcl icetool utility..
but in cobol its not that easy but possible...
consider the scenario...
file 1 file2
5 2
4 1
6 9
1 4
considering this flat seq file:
here the files are not sorted in order and need not be..
so we should take first record from file1 and match with
all the four records in file2 it should continue for end of
file and do the same for file2. can use array logic.
sorting logic in cobol wont be useful here..
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / ravi
JOB INPUT (INFILE1 KEY (INFIL1-ID) +
INFILE2 KEY (INFIL2-ID))
IF MATCHED
PUT OUTFILE1
ELSE
IF INFILE2
OUT1-REC = INFIL1-REC
PUT OUTFILE2
ELSE
OUT1-REC = INFIL2-REC
PUT OUTFILE2
END-IF
END-IF
.
| Is This Answer Correct ? | 1 Yes | 1 No |
What are the differences between OS VS COBOL and VS COBOL II?
how many divisions are there in cobol
Sending data is aplhabetic size 7 (value 3000), I wantated this value to be stored in database, which is defined as s9(7)v9(2)comp-3.
input 1 input2 ouput1 output2 output 3 1 re 300 1 re 200 1 re 300 3 rc 500 1 re 200 2 rr 400 1 re 300 2 rr 400 1 rc 400 3 rc 500 1 rc 400 2 rr 700 2 rr 700 5 tt 900 5 tt 900 2 inputs r in flat file and output 1 is matched records,ouptput2 is unmatched of input1,output3 is unmatched of input2! how vl u get the output files using sequential order and to check with each and every records! let me know the procedure division ?
if a file has 1000 recods how copy the records from 1 to 100 records using sort
How can I find the maximum value of a field in a file while reading the file dynamically? without using sort function. Suppose i have a file with fields Timestamp, description, teamname, teamnumber.. i have read the file till end and find the maximun value of timestamp which is not in sorted order.. can we use function max(timestamp)?
hi friends,can any one post the ibm mainframe inteqview questions for 1year exp candidate,for itc infotech interview?. have any body attended for this in the past?...
TO abend the data sholud open in which mode? 1.new 2.old 3.mod 4.shr
Write the code to count the sum of n natural numbers.
How do you define a table/array in COBOL?
If i got a job on mainframe technology, will i have a bright future?. Some people are discouraging me. Let me know, is it true? Please bring back me from the confusion.
which is better comp or comp-3 in terms of memory utilization?