View previous topic :: View next topic
|
Author |
Message |
useit
Active User
Joined: 05 Oct 2006 Posts: 152
|
|
|
|
HI,
i have a file. layout is as below.
lrecl=18,
01 rec.
05 depot 9(5).
05 product 9(9).
05 qty S9(7) comp-3.
if in case the qty field has junk value then I should replace it with zero. Can we check this? Something like is numeric kind of check?
Regds,
useit |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
DEFINE A JUNK VALUE? You do realize that a comp-3 field would not be viewable field? |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
Back to top |
|
|
useit
Active User
Joined: 05 Oct 2006 Posts: 152
|
|
|
|
Hi,
i know alt seq is used only when we know the exact value..then by using ALTSEQ we can replace it. but i my case i will not be knowig the exact value.
i case the value doesnt fall between 0 and 9999999 I should replace those values with zero.
say in case of high values, low values, -ve values etc...
Regds,
useit. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
well, I remember Frank saying something about numeric checks being
possible in sort.
so I knew that if I ever needed to do that,
if would just take looking in the manual to find out how it is done.
i guess you are waiting for someone to give you the code? huh? |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
You are in DFSORT forum, DFSORT manuals are available on the web, verify there if you can test a comp-3 for numeric.
How about trying less than zero or greater than your max value? Have a check on what a non-numeric in a PD is treated as in DFSORT. It's all in the manual, I expect. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
useit,
If I understand what you want to do (and I'm not sure I do), then you can use these DFSORT statements:
Code: |
OPTION COPY
INREC IFTHEN=(WHEN=(15,4,PD,NE,NUM),
OVERLAY=(15:+0,TO=PD,LENGTH=4))
|
|
|
Back to top |
|
|
|