i want to use only first 100 records from a file.plz tell
me how to write JCL for this(for read,copy,write
operations).plz give me details of all posible JCL
utilities?

Answers were Sorted based on User's Feedback



i want to use only first 100 records from a file.plz tell me how to write JCL for this(for read,co..

Answer / madhuri tungal

Use IDCAMS program.

//.........JOB........
//STEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
REPRO INDATASET(INPUT FILE) OUTDATASET(OUTPUT FILE)
SKIP(0) COUNT(100)
/*

Is This Answer Correct ?    37 Yes 2 No

i want to use only first 100 records from a file.plz tell me how to write JCL for this(for read,co..

Answer / selva

SORT FIELD=COPY, SKIPREC=200 (OR SOME MORE RECORDS),
STOPAFT=100

will skip first 200 records, the correct option is

SORT FIELD=COPY,STOPAFT=100

Is This Answer Correct ?    17 Yes 0 No

i want to use only first 100 records from a file.plz tell me how to write JCL for this(for read,co..

Answer / khbnaidu

Using SORT you can do this...

SORT FIELD=COPY, SKIPREC=200 (OR SOME MORE RECORDS),
STOPAFT=100

Is This Answer Correct ?    15 Yes 10 No

i want to use only first 100 records from a file.plz tell me how to write JCL for this(for read,co..

Answer / santy

Hi,

U can use only first 100 records from a file by using the
IDCAMS utility.

JCL to perform this operation is as below,

//JOBNAME JOB ,, Notify=User_id
//STEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//INDATA DD DSNAME=DATA1
//OUTDATA DD DSNAME=DATA2
//SYSIN DD *
REPRO
INFILE(INDATA) OUTFILE(OUTDATA)
START(0) COUNT(100)
/*


COUNT variable in JCL with start counting a record from
start position 0 and count first 100 record.

Is This Answer Correct ?    8 Yes 3 No

i want to use only first 100 records from a file.plz tell me how to write JCL for this(for read,co..

Answer / arul anand.a

SORT FIELD=COPY,
SKIPREC=0 ( skip 0 records)
STOPAFT=100 (stop after 100 records).

so it will copy only first 100 records.

Is This Answer Correct ?    6 Yes 1 No

i want to use only first 100 records from a file.plz tell me how to write JCL for this(for read,co..

Answer / nataraj

copy file to esds file this file only sequance order so copy
only first 100 records

Is This Answer Correct ?    4 Yes 1 No

i want to use only first 100 records from a file.plz tell me how to write JCL for this(for read,co..

Answer / santy

by using IDCAMS utility u can do this.

//JOBNAME JOB ,, Notify=User_id
//STEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//INDATA DD DSNAME=DATA1
//OUTDATA DD DSNAME=DATA2
//SYSIN DD *
REPRO
INFILE(INDATA) OUTFILE(OUTDATA)
START(0) SKIP(100)
/*

Is This Answer Correct ?    7 Yes 8 No

Post New Answer

More COBOL Interview Questions

Difference between ps, esds

3 Answers  


What is the Purpose of Pointer in the string?

0 Answers  


what are the limitations of Inline Perform?

3 Answers   Zensar,


Can we dynamically increase the size of occurs clause? i.e In case I an not sure of the size of array and want to increase the size at run time.If yes , how?

1 Answers  


how do you move only numeric data from A to B 01 A pic x(10) value 'a1b2c34d5e'. 01 B pic x(5).

2 Answers   DELL, Mind Tree,






a. Can the OPTIONAL clause in COBOL only be coded for input files? b. If it is coded for files opened in OUTPUT, I-O or EXTEND mode, will it give a compilation error? c. If there are no compilation errors and if such files are not coded in the JCL, will the OPEN statement run fine when these files are opened? d. How will a WRITE statement work for the above files?

2 Answers  


COBOL Snippet: Tell where the control will when the below code execute IF (A=B) CONTINUE ELSE NEXT SENTENCE PERFORM <IMP-STMT> END-IF.

7 Answers   HCL,


INREC AND OUTREC? HOW TO SPLIT 5K RECORDS TO DIFFERENT FILES IN A FILE IN COBOL? RESTART IN COBOL-DB2? ISOLATION LEVELS?

0 Answers  


What are different file OPEN modes available in COBOL?

4 Answers   Sun Life,


What is Static and Dynamic linking ?

3 Answers  


i made it to stage 3 of an interview process wednessday they will quiz my knowledge again face to face for an analyst role recruiter said it will be based on Business requirements system is cobol and good ideas what they might ask etc

0 Answers  


Hi................... I have records like this aaaa cccc bbbb And i want output like this bbbb cccc aaaa How can it possible ?. Note:Please make sure records are in unsorted order. somebody plzzz help me.

1 Answers  


Categories