View previous topic :: View next topic
|
Author |
Message |
santoshkumarmanilakkoju
New User
Joined: 24 Nov 2009 Posts: 37 Location: Don't know
|
|
|
|
How to change a record to '20100101' when its first two bytes are '00' using sort?
This a date change requirement the starting position is 47.
If the first two bytes of 47th column of a record is '00' then we need to replace the 8 bytes data from 47th column of the same record to '2010101' |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Quote: |
we need to replace the 8 bytes data from 47th column of the same record to '2010101'
|
2010101 only 7 bytes is it correct?
What sort product are you using? |
|
Back to top |
|
|
santoshkumarmanilakkoju
New User
Joined: 24 Nov 2009 Posts: 37 Location: Don't know
|
|
|
|
its actually '20100101'. We use SYNCSORT |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
try
Code: |
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=(47,2,CH,EQ,C'00'),OVERLAY=(47:C'20100101'))
|
Gerry |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Below SORTCARD will give you desired result.
Code: |
//SYSIN DD *
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=(47,2,CH,EQ,C'00'),OVERLAY=(47:C'20100101'))
|
|
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Opps.. Sorry Gerry.. I couldn't see your post. Anywasy this should be moved to JCL forum |
|
Back to top |
|
|
santoshkumarmanilakkoju
New User
Joined: 24 Nov 2009 Posts: 37 Location: Don't know
|
|
|
|
Hi Sambhaji/Gerry
The code worked but I need the same change to be done for another date field atrting at 55th position.
Below is what I tried but the second field is not changing, the sort is copying the same input to ouput.
Ex: 0010010100100101 is changed to 2010010100100101
//SYSIN DD *
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=(47,2,CH,EQ,C'00'),OVERLAY=(47:C'20100101')),
IFTHEN=(WHEN=(55,2,CH,EQ,C'00'),OVERLAY=(55:C'20100101'))
/*
[/list][/code] |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Use below one.
Code: |
//SYSIN DD *
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=(47,2,CH,EQ,C'00'),OVERLAY=(47:C'20100101'),HIT=NEXT),
IFTHEN=(WHEN=(55,2,CH,EQ,C'00'),OVERLAY=(55:C'20100101'))
/*
|
|
|
Back to top |
|
|
santoshkumarmanilakkoju
New User
Joined: 24 Nov 2009 Posts: 37 Location: Don't know
|
|
|
|
Yes I tried this,
//SYSIN DD *
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=(47,2,CH,EQ,C'00'),
OVERLAY=(47:C'20100101'),HIT=NEXT),
IFTHEN=(WHEN=(55,2,CH,EQ,C'00'),OVERLAY=(55:C'20100101'))
/*
and it worked.Thankyou |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
You are welcome.. |
|
Back to top |
|
|
|