Hi,
What is WHEN=INIT and WHEN= GROUP in JCL sort.
Could someone please guide.
What is WHEN=INIT and WHEN= GROUP in JCL sort
-
- Registered Member
- Posts: 22
- Joined: Thu Jan 30, 2014 9:58 am
- Robert Sample
- Global Moderator
- Posts: 1900
- Joined: Fri Jun 28, 2013 1:22 am
- Location: Dubuque Iowa
Re: What is WHEN=INIT and WHEN= GROUP in JCL sort
From the z/OS DFSORT: Getting Started manual:
WHEN=INIT: Use one or more WHEN=INIT clauses to apply BUILD, FINDREP or OVERLAY items to all of your input records. WHEN=INIT clauses and WHEN=GROUP clauses are processed before any of the other IFTHEN clauses.
WHEN=GROUP: Use one or more WHEN=GROUP clauses to propagate fields, identifiers and sequence numbers within groups of records. You define the records that belong to a group using an appropriate combination of BEGIN=(logexp), END=(logexp), KEYBEGIN=(field) and RECORDS=n parameters.
-
- Registered Member
- Posts: 22
- Joined: Thu Jan 30, 2014 9:58 am
Re: What is WHEN=INIT and WHEN= GROUP in JCL sort
Thank you Robert.
I looked at that definition myself too, but I fail to understand it. I was not able to understand what makes a group, INIT is possibly when the first expression met.
I looked at that definition myself too, but I fail to understand it. I was not able to understand what makes a group, INIT is possibly when the first expression met.
- Robert Sample
- Global Moderator
- Posts: 1900
- Joined: Fri Jun 28, 2013 1:22 am
- Location: Dubuque Iowa
Re: What is WHEN=INIT and WHEN= GROUP in JCL sort
A group is whatever you need it to be -- it could be based upon the values in a particular column or columns, for example.You define the records that belong to a group using an appropriate combination of BEGIN=(logexp), END=(logexp), KEYBEGIN=(field) and RECORDS=n parameters.
WHEN=INIT applies to all the records, while WHEN=GROUP only applies to those records which meet the criteria you've established.
-
- Registered Member
- Posts: 22
- Joined: Thu Jan 30, 2014 9:58 am
Create an account or sign in to join the discussion
You need to be a member in order to post a reply
Create an account
Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute