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

when does a dataset go uncataloged?

0 Answers   IBM,


what if any ,is the syntax error in the following piece of code 01 B PIC A(7) 02 C PIC 9(4) ........ IF(B NUMERIC) ADD 10 TO C a.the condition in the if statement is wrong b.noting is wrong c.because C is initialised.ADD 10 TO C is wrong d.both B and C shoud have same size.

1 Answers  


What are the 2 types of parameters in dd statement?

0 Answers  


How to DEBUG a JCL?

9 Answers   Satyam,


Explain about LMFREE�free data set from its association with data ID

0 Answers  






How to identify where file is empty or not? How many ways are there to identifying?

3 Answers   CTS,


What is the function of the dd dcb keyword?

0 Answers  


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

13 Answers  


which utility is used a dummy utility?

0 Answers   IBM,


How to pass data to a program that is coded in an exec statement?

0 Answers  


Can I copy the FB (fixed Block) record length file to a VB (variable Block)record length file and Vise Versa? If Yes then how ? is that thru one of the JCL utility ?

3 Answers  


is it possible to submitt more than one job in job card in jcl? and if yes than is it necessary to have the jobs same name?

4 Answers   Accenture,


Categories