Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Removing nonnumeric values from a numeric fields thru JCL.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Removing nonnumeric values from a numeric fields thru JCL.
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: 8057
Location: East Dubuque, Illinois, USA

PostPosted: Sat Aug 01, 2009 9:23 am    Post subject:
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

Site Director


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

PostPosted: Sat Aug 01, 2009 10:03 am    Post subject:
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 Moderator


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

PostPosted: Mon Aug 03, 2009 9:04 pm    Post subject:
Reply with quote

Saubhik,

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

http://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

Site Director


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

PostPosted: Mon Aug 03, 2009 11:31 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Sorting of hex values Saurabh_mi DFSORT/ICETOOL 10 Thu May 25, 2017 3:49 pm
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts Sum Fields ballaswaroop DFSORT/ICETOOL 4 Tue May 02, 2017 11:07 am
No new posts Compare two files and subtract values ameetmund DFSORT/ICETOOL 7 Fri Mar 31, 2017 3:35 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us