View previous topic :: View next topic
|
Author |
Message |
saubhik
New User
Joined: 21 Sep 2007 Posts: 35 Location: kolkata
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
sandeep chourasia
New User
Joined: 27 Aug 2009 Posts: 3 Location: India
|
|
|
|
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 |
|
|
|