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


Please Help Members By Posting Answers For Below Questions

Is automatic restart possible in jcl? If yes, how?

651


How to do automated restart when a job abend?

787


What are some jcl statements that are not allowed in procedures?

722


What is the significance of addrspc parameter in exec statement?

724


in ways data can be passed to a COBOL program from JCL?

661






How do you create a temporary dataset?

658


What are the utility programs in jcl?

644


Explain in DD statement what is the use of DCB parameter?

648


How do you submit a job for execution?

634


what operation is performed by job statement?

654


What are the parameter we cannot use in procedure? How many instream we can write in single jcl?

577


What is the purpose of dd * statement in jcl?

793


hello friends ,i have exam in Hsbc,pls any on send me placement papers and technical questions on mainframes,thank u

1659


Is their any limit for data sets?

699


How to execute 2nd and 4th steps among 5 steps in jcl proc?

745