I have one GDG.
Everyday One new version is being created.Now I want to
split this created version in different files each having
1000 records.
Here Problem is I don't know How many records will be there
in new version of GDG?
that's why I don't know How many Out files we need to use .

Interesting??????????????

Answers were Sorted based on User's Feedback



I have one GDG. Everyday One new version is being created.Now I want to split this created versio..

Answer / ashl

Write a Clist that will take the input file read the first 1000 records and create
an output file. After 1000 records are created the next record should be
written to a new file. The Clist can allocate files during execution.

The timing of the file allocation will be handled logically by the program.
Keep a counter, once it reaches 1000, initialize the variable and and create a
new file.

The output file names will vary with each file.

Execute the Clist as a step in your job and once the step completes the
output should be different files with 1000 records.

Is This Answer Correct ?    5 Yes 0 No

I have one GDG. Everyday One new version is being created.Now I want to split this created versio..

Answer / xx

Give your GDG base in the i/p DD name of SORt step. Use
SPLIT parameter in SORT to complete the task. When you use
GDG base all generation of that GDG will be considered.

Is This Answer Correct ?    4 Yes 0 No

I have one GDG. Everyday One new version is being created.Now I want to split this created versio..

Answer / shridhar

STEP001 : Selcopy/utility to count no of records in GDG.
Just mention GDG base in input to include all versions.

STEP002 : REXX step. define a stem of 1000. read input
batch of 1000 records or if not 1000 then for actual count.
Alloc a new file dynamically. Write these no of records.
Reduce actual count by no of records written.
Repeat procedure untill no of records <= 0.

Is This Answer Correct ?    1 Yes 1 No

I have one GDG. Everyday One new version is being created.Now I want to split this created versio..

Answer / neelu

i think we need to generate a JCL through a cobol program
and then run the Created JCL.

Is This Answer Correct ?    0 Yes 3 No

Post New Answer

More JCL Interview Questions

Suppose i have a file with 10 recs and i want to skip only the 7 th record and copy the rest into another file. How do i do it using SORT?

7 Answers   VS, Wipro,


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

0 Answers  


What is Backward Referencing ?

3 Answers   HSBC,


What is the difference between a symbolic and an override in executing a PROC?

2 Answers  


What are some jcl statements that are not allowed in procedures?

0 Answers  






Write a jcl to execute a job by 7 a.m on Jan 20,1986 ?

5 Answers   Maples, Patni, TCS,


Explain the function of the steplib dd statement?

0 Answers  


Can we browse or edit the GDG dataset if it is a tape entry?

4 Answers  


How many steps we can overide in the proc's?

2 Answers   CS,


with out sorting how to copy records from one file to another file using jcl.Mean I have one input file in which the record are like 1,6,5,4,2,3(for example) and i want to copy to output file from top to bottom(without sorting) like 3,2,4,5,6,1.so I want the JCL for this.cna any one can answers?

1 Answers   TCS,


In a single step if input file is present then only need to copy into output file or else need to through a RC is it possible. Note : i want it in a single step

1 Answers  


What is the difference between the JOBLIB and the STEPLIB statements?

3 Answers  


Categories