View previous topic :: View next topic
|
Author |
Message |
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Spent five minutes and looked at the Smart DFSORT Tricks
Quote: |
Change a C sign to an F sign in PD values
A customer asked the following question:
I have three 5-byte packed decimal fields starting in positions 1, 6 and 11.
The positive values have a C sign (e.g X'123456789C'), but I need them to have an F sign.
The negative values have a D sign which I don't want to change.
Can DFSORT change the sign from C to F for the positive values?
DFSORT's TO=PDF feature makes it easy to change the C sign to an F sign in your PD values.
In this case, we can use OVERLAY to change the signs in the three specified fields
without changing anything else in each record.
Here's the control statements we'd use:
OPTION COPY
INREC OVERLAY=(1:1,5,PD,TO=PDF,
6:6,5,PD,TO=PDF,
11:11,5,PD,TO=PDF)
TO=PDF sets an F sign for each positive PD value regardless of whether it originally had an F sign or a C sign.
TO=PDC sets a C sign for positive PD values.
TO=ZDF sets an F sign for positive ZD values.
TO=ZDC sets a C sign for positive ZD values. the D sign is kept for negative values in all cases. |
|
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Jai Hind,
I can show you how to do what you want but I need more information.
Is 11 the starting position of the PD field in both files?
Which file has the PD field with the C sign?
Which file has the PD field with the F sign?
Which sign (C or F) do you want in the output records?
What is the RECFM and LRECL of each input file? |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Dick,
It's not that I don't appreciate people trying to help - it's just that I get in later then everyone else because I'm on the U.S. West Coast and then I have to plow through all of the posts which is kind of counterproductive for me. There are 22 posts here in this thread. It should only have taken less than 5 at the most if I could have just asked the right questions myself. I just get a little tired of plowing through all these "good intentions". Even if the 22 posts helped clarify what was needed, that's a lot of posts. I think I can hone in on the problem and provide a solution more quickly in most cases, so I think the long discussions (and metadiscussions resulting from the discussions) are more of a distraction then a help. I hope you understand. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Yes, you're right. I've deferred even looking at that one until later today.
Quote: |
Understand you, will comply. |
Thanks. |
|
Back to top |
|
|
|