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

Removing nonnumeric values from a numeric fields thru JCL.


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
saubhik

New User


Joined: 21 Sep 2007
Posts: 35
Location: kolkata

PostPosted: Sat Aug 01, 2009 8:34 am
Reply with quote

In my input file i have a amount fields defined as s9(11)v99.But in this input file some non numeric records got inserted in the amount field.I want to remove non numeric records thru jcl.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Sat Aug 01, 2009 9:23 am
Reply with quote

JCL executes programs. It doesn't change files, it doesn't fix files, it doesn't do anything but execute programs.

So, tell us which program you want to use and we can help. But as your problem is stated, it cannot be done because JCL cannot change the contents of files.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sat Aug 01, 2009 10:03 am
Reply with quote

Hello,

Suggest you talk with others on your project about how they approach a similar requirement. Even if they say they "do it with a jcl", ask to see the jcl and look at which program is actually executed.

Once you know which program others use, post back here with a more detailed description of what you want to do. Information about the input data (position, length, and data type of the input to be changed). The same for the output. The dsorg and lrecl of both files.

Then the tough part icon_smile.gif Explain the misconception to any others who believe "things" can be done "with jcl". People here at the forum are most willing to explain why this is a mis-use of the terminology if anyone has doubts.
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: Mon Aug 03, 2009 9:04 pm
Reply with quote

Saubhik,

You can use the technique discussed in the "Check for a numeric string" Smart DFSORT Trick at:

www.ibm.com/support/docview.wss?rs=0&uid=isg3T7000094

s9(11)v99 is a 13-byte ZD field so:

Code:

    OPTION COPY
    OMIT COND=(p,13,ZD,NE,NUM)


where p is the starting position of your ZD field.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Aug 03, 2009 11:31 pm
Reply with quote

Hello,

Quote:
I want to remove non numeric records thru jcl.
What about the data that is in the rest of the record? Suggest simply throwing away the records is not the best choice.

Possibly copying the bad records to some file for further research/correction, but not merely discarding them with no audit trail . . .
Back to top
View user's profile Send private message
sandeep chourasia

New User


Joined: 27 Aug 2009
Posts: 3
Location: India

PostPosted: Fri Aug 28, 2009 1:09 am
Reply with quote

Hi,

You can use the sort sysin card as:

SORT FIELDS=COPY
OUTFIL FNAMES=CORRECT,OMIT=(start_pos,13,ZD,NE,NUM)
OUTFIL FNAMES=INCORRCT,SAVE

The file specified for DDNAME CORRECT will contain the records with the numeric data at the specified position.

The file specified for DDNAME INCORRCT will contain the records with the non-numeric data at the specified position.
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Null values are considered in Total c... DFSORT/ICETOOL 6
No new posts Convert HEX to Numeric DB2 3
Search our Forums:

Back to Top