a input file contains 1000 records, how to move the first
500 record into one out put file and how to move to second
500 records to anothere output file

Answers were Sorted based on User's Feedback



a input file contains 1000 records, how to move the first 500 record into one out put file and how..

Answer / bvr

THIS IS FOR COPY FIRST 500 RECORDS
using IDCAMS utility
//sysin DD*
REPRO -
INFILE(DD1) -
OUTFILE(DD2) -
COUNT(500) THIS IS FOR COPY FIRST 100 RECORDS
/*

THIS IS FOR COPY next 100 RECORDS
using IDCAMS utility
//sysin DD*
REPRO -
INFILE(DD1) -
OUTFILE(DD2) -
skip(500) -
COUNT(500)
/*

Is This Answer Correct ?    15 Yes 4 No

a input file contains 1000 records, how to move the first 500 record into one out put file and how..

Answer / balusu

//STEP0020 EXEC PGM=SORT
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=FSS012.SAMPLE.IN,DISP=SHR
//SORTOUT DD DSN=FSS012.SAMPLE.OUT4,
// SPACE=(TRK,(5,5),RLSE),
// DCB=(LRECL=80,BLKSIZE=800,RECFM=FB),
// UNIT=SYSDA,
// DISP=(NEW,CATLG,DELETE)
//SYSIN DD *
SORT FIELDS=COPY,STOPAFT=501
/*
//STEP0021 EXEC PGM=SORT
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=FSS012.SAMPLE.IN,DISP=SHR
//SORTOUT DD DSN=FSS012.SAMPLE.OUT5,
// SPACE=(TRK,(5,5),RLSE),
// DCB=(LRECL=80,BLKSIZE=800,RECFM=FB),
// UNIT=SYSDA,
// DISP=(NEW,CATLG,DELETE)
//SYSIN DD *
SORT FIELDS=COPY,SKIPREC=499
/*

Is This Answer Correct ?    5 Yes 0 No

a input file contains 1000 records, how to move the first 500 record into one out put file and how..

Answer / varsha

Using SPLITBY option, you can do it in one step only -

//JOBNAME
//STEP1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=INPUT DSN,DISP=SHR
//OUT1 DD DSN=OUTPUT DSN1,DISP=(NEW,CATLG),
// SPACE=(CYL,(5,5)),UNIT=SYSDA
//OUT2 DD DSN=OUTPUT DSN2,DISP=(NEW,CATLG),
// SPACE=(CYL,(5,5)),UNIT=SYSDA
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL FNAMES=(OUT1,OUT2),SPLITBY=500
/*
//


Please correct .. if I am wrong

Is This Answer Correct ?    5 Yes 0 No

a input file contains 1000 records, how to move the first 500 record into one out put file and how..

Answer / nishant

using IDCAMS utility
//sysin DD*
REPRO -
INFILE(DD1) -
OUTFILE(DD2) -
COUNT(500) COPYING FIRST 500 RECORDS
SKIP(500)
REPRO -
INFILE(DD1) -
OUTFILE(DD3) -
skip(500) -
COUNT(500) COPYING NEXT 500 RECORDS
/*

Is This Answer Correct ?    1 Yes 0 No

a input file contains 1000 records, how to move the first 500 record into one out put file and how..

Answer / kalpesh

THIS IS FOR COPYING FIRST 500 RECORDS
using IDCAMS utility
//sysin DD*
REPRO -
INFILE(DD1) -
OUTFILE(DD2) -
COUNT(500) COPYING FIRST 500 RECORDS
SKIP(500)
/*

THIS IS FOR COPY next 500 RECORDS
using IDCAMS utility
//sysin DD*
REPRO -
INFILE(DD1) -
OUTFILE(DD2) -
skip(500) -
COUNT(500) COPYING FIRST 500 RECORDS
/*

Is This Answer Correct ?    0 Yes 0 No

a input file contains 1000 records, how to move the first 500 record into one out put file and how..

Answer / saurabh gupta

using IDCAMS utility
//sysin DD*
REPRO -
INFILE(DD1) -
OUTFILE(DD2) -
COUNT(500) THIS IS FOR COPY FIRST 100 RECORDS
SKIP(500) IF WE WANT TO COPY ONLY 501 TO 1000 RECORDS
/*

Is This Answer Correct ?    2 Yes 5 No

Post New Answer

More JCL Interview Questions

Is CPU time assigned to a JOB and JOBSTEP BOTH, by default ?

4 Answers   IBM,


What is Cataloged Procedures?

0 Answers  


If I defined space as TRK(10,10) for the one file and lrecl = 4K then tell me how many record will vsam file will contain. will it 1,2,3,4,5 or how many,

3 Answers   IBM,


when can a job time-out occur? How to overcome that?

0 Answers   IBM,


Is there a limit of 3273 DD statements for a JCL or for every EXEC step in a JCL?

2 Answers  






Hi Please try to be to-the-point. 1) How to INCLUDE a JCL segment in a JOB ? (A Small example) 2) What is SPOOL and what is SPOOL FULL ? and how to direct the output of a Jobstep to SPOOL ?

3 Answers   IBM,


What is concatenating?

0 Answers  


how to set dependancy for jobs?

4 Answers  


i want to store 20 digits . how will u do it in cobol ?

0 Answers  


diff bw SB37,SD37,SE37 ?( bcz these 3 belongs Space related abends only)

4 Answers   RBS,


What is COND=ONLY ?

2 Answers  


what is use of dcb parameter in dd statement?

0 Answers   IBM,


Categories