View previous topic :: View next topic
|
Author |
Message |
senjay
Active User
Joined: 10 May 2007 Posts: 147 Location: India
|
|
|
|
Hi,
I need to select some records based on a check by the part of a PD value in a single step. how to do this.
for ex,
if the PD field has 8 digit value, i need to perform the check based on last 6 digit. |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Could you INREC reformat it to ZD and compare against that? |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
You can use DFSORT's PD0 format to check on the last 6 digits of a PD value. For example if you had a PD value in positions 1-5 with X'987123456C' and you wanted to check for 123456 as the last 6 digits you could use:
Code: |
INCLUDE COND=(2,4,PD0,EQ,X'123456')
|
2,4 would be X'712346C'. Since PD0 ignores the first digit and the sign, you'd be checking for 123456 ignoring the 7 and the C. In general, the 2,4,PD0 value would be treated as X'iddddddi' where i is ignored and d is checked. |
|
Back to top |
|
|
krisprems
Active Member
Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
|
|
senjay
Quote: |
i need to perform the check based on last 6 digit.
|
What sort of check you wanted to do? Please show an example
Because i feel that, you can use the MOD function of DFSORT and do the task in single step, by extracting only the last 6 digits of the 8digit i/p. |
|
Back to top |
|
|
krisprems
Active Member
Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
Back to top |
|
|
senjay
Active User
Joined: 10 May 2007 Posts: 147 Location: India
|
|
|
|
Thanks all. |
|
Back to top |
|
|
|