Apply odd and even number in records of a file.

IBM's Sort Product, ICETOOL, ICEMAN and ICEGENER.
Post Reply
Dicta Mitra
Registered Member
Posts: 15
Joined: Sat Jan 16, 2016 12:46 pm

Apply odd and even number in records of a file.

Post by Dicta Mitra »

Hi,

how do I append "even" & "odd" indicator to even and odd records of a ps file using sort jcl.
Dicta Mitra
Registered Member
Posts: 15
Joined: Sat Jan 16, 2016 12:46 pm

Re: Apply odd and even number in records of a file.

Post by Dicta Mitra »

Could anyone guide on this?
User avatar
Anuj Dhawan
Founder
Posts: 2802
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Contact:
India

Re: Apply odd and even number in records of a file.

Post by Anuj Dhawan »

Without much info on hand about the details of data you are working with, SEQNUM can work for you:

Code: Select all

SORT FIELDS=(1,length,CH,A)
OUTREC OVERLAY=(81:SEQNUM,5,ZD)
This will add a sequence number of length 5 at position 81.
Thanks,
Anuj

Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Dicta Mitra
Registered Member
Posts: 15
Joined: Sat Jan 16, 2016 12:46 pm

Re: Apply odd and even number in records of a file.

Post by Dicta Mitra »

What is SEQNUM, though this is working as expected.
User avatar
Anuj Dhawan
Founder
Posts: 2802
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Contact:
India

Re: Apply odd and even number in records of a file.

Post by Anuj Dhawan »

You can use SEQNUM,m,f to create sequence numbers of various lengths in various formats. You can use START=j to start the sequence numbers at j instead of 1. You can use INCR=i to increment each sequence number by i instead of 1. You can use RESTART=(p,m) to start the sequence number at the starting value again each time the value in a particular field changes.
Thanks,
Anuj

Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
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.”