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

I have mainpgm(abc) this is the only cobol pgm(non-db2).And this pgm calling subpgm name "acd" this also only cobol(non- Db)and this pgm calling some other subpgm this pgm has cobol-db2 pgm. 1) IF you calling static mode how to run and how to compile? 2) IF you calling dynamic mode how to run and how to compile? plz suggestion me.

0 Answers   HP,


What is DATACOM db?

2 Answers  


How do you submit JCL via a Cobol program?

2 Answers   Cap Gemini,


What are the valid DSORG values ?

3 Answers  


What is the difference between catalogue procedure and In-Stream procedure?

2 Answers  






AM HAVING A FILE WHICH CONTAIN 12 DATS OUT OF WHICH 4 ARE DUPLICATES HOW TO REMOVE THE DUPLICATE FILES IN JCL? CAN I GET THE PROGRAM FOR THIS

3 Answers  


Could anyone please suggest me what is the maximum length of data that can be pass as input in //sysin dd * This was asked in interview. TIA

3 Answers   VC, Wipro,


I have 10 steps, I want to run STEP1 TO STEP4 then I should not run STEP5 and STEP6. Aganin I want to execute from STEP7 to STEP10. ONLY using CONDITION CODES how can we execute this process? 1. Where we can set cond codes for STEP5 and STEP6? 2. How can we execute remaining steps from STEP7 to STEP10?

2 Answers  


How to change default PROCLIB?

1 Answers  


What is the format of comment statement?

0 Answers  


what is use of dsn parameter in dd statement?

0 Answers   IBM,


What is the error in the following JCL statements : I) //step#three exec pgm=hkbc762 ii) //step#3 exec pgm = hkbc762 iii) //step#3 exec pgr = hkbc672

6 Answers  


Categories