Hi,
how do I append "even" & "odd" indicator to even and odd records of a ps file using sort jcl.
Apply odd and even number in records of a file.
-
- Registered Member
- Posts: 15
- Joined: Sat Jan 16, 2016 12:46 pm
-
- Registered Member
- Posts: 15
- Joined: Sat Jan 16, 2016 12:46 pm
- Anuj Dhawan
- Founder
- Posts: 2824
- Joined: Sun Apr 21, 2013 7:40 pm
- Location: Mumbai, India
- Contact:
Re: Apply odd and even number in records of a file.
Without much info on hand about the details of data you are working with, SEQNUM can work for you:
This will add a sequence number of length 5 at position 81.
Code: Select all
SORT FIELDS=(1,length,CH,A)
OUTREC OVERLAY=(81:SEQNUM,5,ZD)
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.
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.
-
- Registered Member
- Posts: 15
- Joined: Sat Jan 16, 2016 12:46 pm
Re: Apply odd and even number in records of a file.
What is SEQNUM, though this is working as expected.
- Anuj Dhawan
- Founder
- Posts: 2824
- Joined: Sun Apr 21, 2013 7:40 pm
- Location: Mumbai, India
- Contact:
Re: Apply odd and even number in records of a file.
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.
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.
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