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
Is automatic restart possible in jcl? If yes, how?
How to do automated restart when a job abend?
What are some jcl statements that are not allowed in procedures?
What is the significance of addrspc parameter in exec statement?
in ways data can be passed to a COBOL program from JCL?
How do you create a temporary dataset?
What are the utility programs in jcl?
Explain in DD statement what is the use of DCB parameter?
How do you submit a job for execution?
what operation is performed by job statement?
What are the parameter we cannot use in procedure? How many instream we can write in single jcl?
What is the purpose of dd * statement in jcl?
hello friends ,i have exam in Hsbc,pls any on send me placement papers and technical questions on mainframes,thank u
Is their any limit for data sets?
How to execute 2nd and 4th steps among 5 steps in jcl proc?