Hi,
I have 3 files say file A , file B and file C.I want to
form an output file in which i will have all the records
from file A. Files B and C also may contain records that
are present in file A.I want those records also to be
included in my output file.
for eg:
file A contains:
1
2
3
file B contains:
2
4
5
file C contains:
1
3
5
So in my output file should look like:
1
2
3
2
1
3
Can any one help ???.....thanks in advance.
Answer Posted / saikishore
I don't know what are you going to tell in your questions.
I am giving the solution according to your example.
STEP1: JOIN FILEB, FILEC.
//SYSIN DD*
JOIN FILES=F1,FIELDS=(1,1,A)
JOIN FILES=F1,FIELDS=(1,1,A)
JOIN UNPAIRED,F1,F2
REFORMAT FIELDS=(F1:1,1,F2:1,1)
INCLUDE COND=(1,1,CH,EQ,C' ',AND,2,1,CH,EQ,C' ')
SORT FIELDS=COPY
/*
STEP2:
//SORTIN DD DSN=FILEA,DISP=SHR
// DD DSN=OUTPUT FILE OF STEP1,DISP=SHR
//SORTOUT DD DSN=FILE6, <- GIVE ALL THE PARAMETERS
//SYSIN DD *
SORT FIELDS=COPY
/*
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
When output dataset space is required, what quantity categories are used?
What is notcat 2 - gs?
Name what parameter directs the output of the job log dataset?
What does a disposition of (MOD,DELETE,DELETE) mean ?
how do you create a dataset in a jcl with the same file organisation as that of another existing dataset?
when can a job time-out occur? How to overcome that?
in a jcl, a large volume dataset is loaded to a table using bmcload in step1 and an image copy of the loaded table is taken using bmccopy in step2. Step2 abends because the image copy dataset cannot hold the volume of the table. How can this be rectified?
How can a fb file convert to vb file using sort program?
Why block size is multiple of lrecl in jcl?
1) SORT FIELDS=(20,4,CH,D,10,3,CH,D) OUTREC FIELDS=(7:20,4,C' FUTURE ',20,2,10,3,1Z,1,9,13,7, 24,57,TRAN=LTOU,6X'FF') This example illustrates how a fixed-length input data set can be sorted and reformatted for output. The SORTIN LRECL is 80 bytes. The reformatted output records are fixed length with a record size of 103 bytes. SOLRF (the IBM-supplied default) is in effect, so unless the SORTOUT LRECL is specified or available, it will automatically be set to the reformatted record length of 103. in the above example i have some doubts that a) sort fields=(20,4,CH,D,10,3,CH,D) -what exactly it does and this fields related to output record fields or input record fields b)outrec used to refprmat the records after sorting that means could please reply me as soon as possible Thanks. Venkat
What parameter directs the output of the job log dataset?
How to submit jcl through a cobol program?
Explain the jcl exec statement?
What is NOTCAT ?
what operation is performed by job statement?