Page 1 of 1
Apply odd and even number in records of a file.
Posted: Tue May 16, 2023 8:37 pm
by Dicta Mitra
Hi,
how do I append "even" & "odd" indicator to even and odd records of a ps file using sort jcl.
Re: Apply odd and even number in records of a file.
Posted: Mon Aug 21, 2023 1:08 pm
by Dicta Mitra
Could anyone guide on this?
Re: Apply odd and even number in records of a file.
Posted: Tue Aug 22, 2023 2:47 pm
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.
Re: Apply odd and even number in records of a file.
Posted: Sat Sep 02, 2023 12:08 pm
by Dicta Mitra
What is SEQNUM, though this is working as expected.
Re: Apply odd and even number in records of a file.
Posted: Wed Sep 06, 2023 3:39 pm
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.