View previous topic :: View next topic
|
Author |
Message |
elijarajesh.mf Warnings : 1 New User
Joined: 02 Feb 2010 Posts: 14 Location: hyderabad
|
|
|
|
Hi,
My input file is having lenght of 40 bytes. Now I would like to know how to
change the values starting form the coloumn 31 based on the coloumn starting from 20,6(position and length).
Here is the example
Input file:
A 202LS372A LSA 202 SPRGA 202 TAMINA TX
A 202LS372A LSE 033 SPRGA 202 TAMINA TX
As per the above file in the second record if the value is E 033 (postion 20)I want to change TAMINA TX to CALIFORNIA TX.
Please let me know how to write this in SYNCSORT.
Thanks,
Rajesh. |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
The field positions you mentioned do not seem to match with that of the sample data. |
|
Back to top |
|
|
acevedo
Active User
Joined: 11 May 2005 Posts: 344 Location: Spain
|
|
|
|
I'd use FINDREP
;) |
|
Back to top |
|
|
elijarajesh.mf Warnings : 1 New User
Joined: 02 Feb 2010 Posts: 14 Location: hyderabad
|
|
|
|
Thank you |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
So the problem solved? You didnot tell about the release of SyncSort you are at - however, just for the record, Support for FINDREP was included in SyncSort for z/OS 1.3.2. |
|
Back to top |
|
|
Alissa Margulies
SYNCSORT Support
Joined: 25 Jul 2007 Posts: 496 Location: USA
|
|
|
|
Based on the actual sample data provided, here is one way to accomplish this task:
Code: |
//SORT1 EXEC PGM=SORT
//SORTIN DD *
A 202LS372A LSA 202 SPRGA 202 TAMINA TX
A 202LS372A LSE 033 SPRGA 202 TAMINA TX
//SORTOUT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
INREC IFTHEN=(WHEN=(17,3,CH,EQ,C'033'),OVERLAY=(31:C'CALIFORNIA TX'))
SORT FIELDS=COPY
/* |
The output produced is as follows:
Code: |
A 202LS372A LSA 202 SPRGA 202 TAMINA TX
A 202LS372A LSE 033 SPRGA 202 CALIFORNIA TX |
Regards, |
|
Back to top |
|
|
|