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.







Answers were Sorted based on User's Feedback



Hi, I have 3 files say file A , file B and file C.I want to form an output file in which i will..

Answer / 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

Hi, I have 3 files say file A , file B and file C.I want to form an output file in which i will..

Answer / murali

@sai Kishore: I'm not able to understand what will be the
output of step1..
Can you please explain the JCL stmts in step1 line by line.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More JCL Interview Questions

How different is the JCL executing a COBOL program? 1) if the program is using VB file as input. 2) if the program is using FB file as input.

1 Answers   HSBC,


WORKING-STORAGE SECTION. 1 GROUP-ITEM. 05 AMOUNT-1 PIC 99V9 USAGE COMP VALUE 50. 05 AMOUNT-2 PIC 9(4)V99 USAGE COMP. PROCEDURE DIVISION. MOVE ZERO TO GROUP-ITEM. ADD 50 TO AMOUNT-1. DISPLAY AMOUNT-1. STOP RUN.

1 Answers  


Can we DELETE all the Generations of a GDG at once, WITHOUT deleting the GDG itself ?

7 Answers   IBM,


after submiting the jcl.how do you know that the job has been completed.

4 Answers   ACS,


Explain how can an in-stream dataset be terminated?

0 Answers  






Can an individual step be restricted from using all the jobs allowed cpu time?

0 Answers  


A. Job Abended in STEP03. Now run job again to execute STEP03, STEP04 (STEP01,STEP02 should not execute again)

3 Answers   Cap Gemini, CSC, Xchanging,


can we maintain 2 generations with different Lengths in Same GDG ?

3 Answers   RBS,


what is pupose and meaning of the REGION keyword and what jcl statement is it associated with?

1 Answers  


how to convert fb to vb in jcl ?

5 Answers   IBM, Infosys,


Suppose your program is reading a Sequential Vsam file. The file contains 10 records. How will you code the JCL to read only 2nd, 5th, 7th,and 10th record?

1 Answers   Thomson,


what is JCL?

0 Answers  


Categories