View previous topic :: View next topic
|
Author |
Message |
Keith Ahearn
New User
Joined: 21 May 2015 Posts: 2 Location: USA
|
|
|
|
Hi all,
Long time since I posted here.
Question: I'm using a sort with OUTREC to replace decimals on a flat file with 0. I've got it working but at the end of each record, the sort is replacing the value in the field with a decimal ('.'). Not sure why this is happening.
Here's what I'm coding for the OUTREC (LRECL=117)
OUTREC FIELDS=(1,43,44,1,CHANGE=(1'.C',C'0'),NOMATCH=(44,1),45,72)
The sort is changing the field (44) as I want but like I said, it's also changing the last position (117) from the value in there (numeric) to a decimal point.
I'm not overly familiar with using OUTREC like this hence my question.
Appreciate any input! |
|
Back to top |
|
|
Keith Ahearn
New User
Joined: 21 May 2015 Posts: 2 Location: USA
|
|
|
|
I figured it out. Works better with the right # of bytes coded for the rest of the record after the NOMATCH (73 instead of 72).
Since I started this, is there anyway to concatenate 2 of these statements? I have it working now in 2 steps because I have decimals in 2 places on the records that I want to replace. Can you run this once in a single sort?
Thanks again. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3076 Location: NYC,USA
|
|
|
|
There are many ways and if you do a SEARCH on this forum you will get examples too. You can use IFTHEN and OVERLAY feature as easy and flexible way.
Show us input data and expected output using code tags. I moved to DFSORT unless you tell me you got SYNCSORT. |
|
Back to top |
|
|
|