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
How to submit jcl through a cobol program?
The disp in the JCL is MOD and the program opens the file in OUTPUT mode. What happens ? The disp in the JCL is SHR and the pgm opens the file in EXTEND mode. What happens ?
What is job control language?
what is DSN in JCL and what are the parameters to declare the DSN?
what happens when COND is coded in JOB statement and when COND is coded inside EXEC statement?
What parameter directs the output of the job log dataset?
What is the use of symbol // in jcl?
Describe the various parameters utilized in the creation of a gdg?
Is it possible to code instream data in a PROC?
When space is allocated for an output dataset, what units can be used?
How is a type of file defined in the jcl that executes the cobol program?
a dd statement has 2 types of parameters. Name them?
how can you check if a file is empty using jcl?
How do you submit a job for execution?
Explain about ISPF/TSO Commands