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

How to validate the special characters in a record


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

New User


Joined: 11 Dec 2009
Posts: 2
Location: Bangalore

PostPosted: Sat May 26, 2012 11:18 pm
Reply with quote

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

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Sat May 26, 2012 11:51 pm
Reply with quote

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

New User


Joined: 11 Dec 2009
Posts: 2
Location: Bangalore

PostPosted: Sun May 27, 2012 12:00 am
Reply with quote

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

Global Moderator


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

PostPosted: Sun May 27, 2012 12:06 am
Reply with quote

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

Moderator Emeritus


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

PostPosted: Sun May 27, 2012 12:06 am
Reply with quote

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

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Sun May 27, 2012 3:36 am
Reply with quote

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

New User


Joined: 15 May 2012
Posts: 5
Location: INDIA

PostPosted: Mon May 28, 2012 12:51 am
Reply with quote

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

Moderator Emeritus


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

PostPosted: Mon May 28, 2012 7:02 am
Reply with quote

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

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Tue May 29, 2012 9:46 pm
Reply with quote

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
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 How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Substring number between 2 characters... DFSORT/ICETOOL 2
No new posts To find whether record count are true... DFSORT/ICETOOL 6
Search our Forums:

Back to Top