What is WHEN=INIT and WHEN= GROUP in JCL sort

IBM's Sort Product, ICETOOL, ICEMAN and ICEGENER.
Post Reply
Sunil Hyderbad
Registered Member
Posts: 22
Joined: Thu Jan 30, 2014 9:58 am

What is WHEN=INIT and WHEN= GROUP in JCL sort

Post by Sunil Hyderbad »

Hi,

What is WHEN=INIT and WHEN= GROUP in JCL sort.

Could someone please guide.
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1895
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: What is WHEN=INIT and WHEN= GROUP in JCL sort

Post by Robert Sample »

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.
Sunil Hyderbad
Registered Member
Posts: 22
Joined: Thu Jan 30, 2014 9:58 am

Re: What is WHEN=INIT and WHEN= GROUP in JCL sort

Post by Sunil Hyderbad »

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.
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1895
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: What is WHEN=INIT and WHEN= GROUP in JCL sort

Post by Robert Sample »

You define the records that belong to a group using an appropriate combination of BEGIN=(logexp), END=(logexp), KEYBEGIN=(field) and RECORDS=n parameters.
A group is whatever you need it to be -- it could be based upon the values in a particular column or columns, for example.

WHEN=INIT applies to all the records, while WHEN=GROUP only applies to those records which meet the criteria you've established.
Sunil Hyderbad
Registered Member
Posts: 22
Joined: Thu Jan 30, 2014 9:58 am

Re: What is WHEN=INIT and WHEN= GROUP in JCL sort

Post by Sunil Hyderbad »

Thanks Robert.
Post Reply

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

Register

Sign in

Return to “IBM DFSort, ICETOOL, ICEMAN, ICEGENER.”