I have two input SORTIN files and We need to create one
SORTOUT file which contains data of both input files. What
is the SortCard for this?. Suppose the length of the both
files are different, then How we do it? Please reply ASAP

Answers were Sorted based on User's Feedback



I have two input SORTIN files and We need to create one SORTOUT file which contains data of both i..

Answer / srk

//jobname job .......
//stepname1 exec pgm=sort
//sysprint dd sysout=*
//sortin01 dd dsn=file1,disp=shr
//sortin02 dd dsn=file2,disp=shr
//sortout dd dsn=mergefile,.......
//sysout dd sysout=*
//sysin dd *
merge fields=(starting field,length,merge-sequence,format)

/*
*above is the merge condition
//

Is This Answer Correct ?    8 Yes 0 No

I have two input SORTIN files and We need to create one SORTOUT file which contains data of both i..

Answer / vikas pujar

1) Sortcard to merge two files will be
//Sysin dd *
Sort fields=copy
/*

2) When try two merge two files using sort, first thing to see is they are of same length. If they are not, change the length of one equal to other in one more step which come prior to sort step.

Is This Answer Correct ?    2 Yes 1 No

I have two input SORTIN files and We need to create one SORTOUT file which contains data of both i..

Answer / srinivas yadav

any one plz write the code for this.

Is This Answer Correct ?    1 Yes 0 No

I have two input SORTIN files and We need to create one SORTOUT file which contains data of both i..

Answer / vikas pujar

Continuation to last answer. If the input files are of VB, even if length vary, files will be merged. The file with Max
RECFM and BLKSIZE will be used for output. But for FB files RECFM should be same.

Is This Answer Correct ?    2 Yes 2 No

Post New Answer

More JCL Interview Questions

Explain COND used in JCL?

1 Answers   Patni,


I found in one of the jcl, gdg version being mentioned as : abc.def.ghi(-0) Can anyone tell me how referring the version as (-0) is different from referring it as (0)

2 Answers  


Explain about User Information

1 Answers  


if we give TIME=0 how many sec that job/step

13 Answers  


Are there any set of rules for the names of the steps used in a job?

0 Answers  






Is automatic restart possible in jcl?

0 Answers  


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 program opens the file in EXTEND mode. What happens ?

3 Answers  


What is catelog procedure and how many catelog procedure to use in one job?

2 Answers   Infosys,


how to skip the steps in JCl

2 Answers   EDS,


a jcl has 2 steps. How to code the jcl such that if step1 abends, then step2 runs. Else, job terminates with step1?

1 Answers   IBM,


if we compile the cobol+ db2 program now ofter 5 years we need to compile again?

1 Answers   TCS,


how to run batch program without jcl?

3 Answers   HSBC, IBM,


Categories