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

How many positional parameters are there in job statement?

4 Answers  


How many types of parameters are used in JCL and what are mandatory parameters of JOB statement.

13 Answers   IBM,


Is it possible to define dd statements as you want?

0 Answers  


a dd statement has 2 types of parameters. Name them?

0 Answers  


Is it possible to code instream data in a PROC?

0 Answers  






Suppose I have a file with three fields with data in the following format 1. empid - S9(4) COMP 2. empname - X(20) 3. empsal - S9(5)V(2) COMP-3 If I view this file, it will not be in a readable format. How to display the empid and empsal fields in a readable format without using COBOL program? What kind of SORT card will have to be coded?

4 Answers  


Can we DELETE all the Generations of a GDG at once, WITHOUT deleting the GDG itself ?

7 Answers   IBM,


How does -818 sql error occur? Why does it happen and what can be done to overcome this error code?

5 Answers   RBS,


what is the purpose of SYSOUT parameter in the DD statement?

1 Answers  


what is the general use of PARM? Give an explanation about the system defined parameters that could be passed through this PARM like XREF,LIST,LET,APOST,RENT etc..

3 Answers   Cognizant,


Explain about RECORDING MODE Clause

1 Answers  


What is Backward Referencing ?

3 Answers   HSBC,


Categories