View previous topic :: View next topic
|
Author |
Message |
itsanunay
New User
Joined: 11 Dec 2009 Posts: 2 Location: Bangalore
|
|
|
|
I am using following control card for date validation:
OPTION COPY
OUTREC OVERLAY=(30:16,8,Y4T,TOGREG=Y4T)
It is working fine when the input field is having numeric or alphabet but it is giving the SOC7 when the record contains the special characters.
Kindly advice me that how can we validate a field is having a special characters. |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
I guess the first thing to do is to find out WHY those characters are there. If you are expecting a date then you should get the creator of the data to give you a date and not something else. If his data is correct then why are you trying to convert non-date data into a date. Somewhere along the line there is mis-communication. Sort out your data first - there may be other "errors" going undetected. |
|
Back to top |
|
|
itsanunay
New User
Joined: 11 Dec 2009 Posts: 2 Location: Bangalore
|
|
|
|
Nic,
Basically, My requirement is that to load the Vendor files into the Admin processing system.
We do not have any control on the vendor data so the requirement is to verify that the input data is correct or not hence i have tried to verify that the input date is valid or not.
It is giving OC7 if the input field is having special characters |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
there are ways to perform 3.7.14 Numeric Tests
i would send all records with non numerics (including alpha, which is a non numeric) to a reject file
and only process those records with valid NUM data. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
How about testing it for NUMeric then? You can also look at what VERIFY does. Manual links at the top of the page. |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
You have plenty of control over it - you tell the vendor his data is wrong and you do not process it until it is corrected. The vendor wants his data processed so he will correct it as otherwise it will cost. If his data is correct then you are wrong in your expectations of what is in the data and you will have to change your processing to correctly process the data - you cannot just pick and choose the data you want. |
|
Back to top |
|
|
HK_Endeavour Forever
New User
Joined: 15 May 2012 Posts: 5 Location: INDIA
|
|
|
|
When you say Special Characters, are they special characters like (*#@!...) or are they double-byte characters like for example European or Chinese Characters?
Your Admin Processing might be unable to accept these characters. If you are supporting vendors sending you files with special characters, you need to look at the possibility of modifying the attributes of your admin processing system to accept special characters.
And sometimes on some Mainframe systems I have worked, I give a tso command "F ALL P'.'" to see if they are any unprintable characters in the file.
With Vendor permission, you can remove these characters.
I would add to what Nic Clouston has said that without prior permission we cannot manipulate Vendor data. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
While the vendor may not agree to "fix" the data, you CAN and should) control what happens when you try to process this data.
If the data is wrong / invalid / whatever, you need to deal with it one way or another.
One way is to simply discard the records with an audit trail of what was deleted (not recommended)
Another is to force some "valid" value and produce an audit trail of whatwas changed. You might also create a reject file as was suggessted.
Yet another (my preference) is to reject the entire file and have it re-created - though not always possible due to "politics" (this is NOT a technical issue, but rather a people issue).. |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
itsanunay wrote: |
I am using following control card for date validation:
OPTION COPY
OUTREC OVERLAY=(30:16,8,Y4T,TOGREG=Y4T)
It is working fine when the input field is having numeric or alphabet but it is giving the SOC7 when the record contains the special characters.
Kindly advice me that how can we validate a field is having a special characters. |
Itsanunay,
As others mentioned you can perform the numeric tests and validate the date. Try these sample cards
Code: |
//SYSIN DD *
OPTION COPY
OUTREC IFTHEN=(WHEN=(16,8,ZD,EQ,NUM),
OVERLAY=(30:16,8,Y4T,TOGREG=Y4T)),
IFTHEN=(WHEN=NONE,OVERLAY=(30:C'INVALID '))
//* |
Remember that TOGREG function also validates if the input data is a valid date. If it finds an invalid date(ex: 2011-02-29) then you will see asterisks in pos 30. |
|
Back to top |
|
|
|