i have two flat files.i want to select one record from that
file by using jcl.for example file1 contains emp
no,name,joining date. file2 has same details.emp no is
primary key. i will give empno.that emp details send to
outfile.please let me know if any one knows it.give sample
code.



i have two flat files.i want to select one record from that file by using jcl.for example file1 co..

Answer / vs kumar

//SORTIN DD DSN=INPUTFILE1,DISP=SHR
//SORTOF01 DD DSN=X.Y.OUTFILE1,DISP=SHR
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL FILES=01,STARTREC=1,ENDREC=1
/*
//SORTIN DD DSN=INPUTFILE2,DISP=SHR
//SORTOF02 DD DSN=X.Y.OUTFILE2,DISP=SHR
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL FILES=02,STARTREC=1,ENDREC=1
/*
//STEP2 EXEC PGM=SORT
//SORTIN DD DSN=X.Y.OUTFILE1,DISP=SHR
// DD DSN=X.Y.OUTFILE2,DISP=SHR
//SORTOUT DD DSN=X.Y.OUTFILE,DISP=SHR
//SYSIN DD *
SORT FIELDS=COPY
/*

Is This Answer Correct ?    0 Yes 3 No

Post New Answer

More JCL Interview Questions

what is a steplib

4 Answers   CGI,


How many days does a job remain in spool

7 Answers   Syntel,


When you specify multiple datasets in a JOBLIB or STEPLIB, what factor determines the order?

1 Answers  


how to solve u4038 abbend?........

3 Answers   Atos Origin, TCS,


how do u send return code from cobol to jcl ?

2 Answers   TCS,


How does -818 sql error occur? Why does it happen and what can be done to overcome this error code?

5 Answers   RBS,


which are the parameters mandatory in job card ?

4 Answers   Accenture,


with out sorting how to copy records from one file to another file using jcl.Mean I have one input file in which the record are like 1,6,5,4,2,3(for example) and i want to copy to output file from top to bottom(without sorting) like 3,2,4,5,6,1.so I want the JCL for this.cna any one can answers?

1 Answers   TCS,


what r the types of job control statements?

2 Answers  


What methodology can be adapted to transfer data to a program that is coded using the exec statement?

1 Answers  


How do you handle empty files in a JCL ?

3 Answers   Wipro, Xansa,


How to override a dsn that is contained in a proc called by another proc? I need to do the override in the calling jcl?

1 Answers  


Categories