IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Find and replace junk value


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
useit

Active User


Joined: 05 Oct 2006
Posts: 152

PostPosted: Tue Oct 18, 2011 6:31 pm
Reply with quote

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
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Tue Oct 18, 2011 6:59 pm
Reply with quote

DEFINE A JUNK VALUE? You do realize that a comp-3 field would not be viewable field?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue Oct 18, 2011 7:01 pm
Reply with quote

useit,
look here.
ibmmainframes.com/viewtopic.php?p=144080&highlight=replace#144080
Back to top
View user's profile Send private message
useit

Active User


Joined: 05 Oct 2006
Posts: 152

PostPosted: Tue Oct 18, 2011 7:32 pm
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue Oct 18, 2011 7:38 pm
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Oct 18, 2011 7:57 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Oct 18, 2011 10:43 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Find the size of a PS file before rea... COBOL Programming 13
Search our Forums:

Back to Top