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
 

 

How to validate the special characters in a record

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: How to validate the special characters in a record
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: 1714
Location: UK

PostPosted: Sat May 26, 2012 11:51 pm    Post subject:
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    Post subject:
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    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7228

PostPosted: Sun May 27, 2012 12:06 am    Post subject: Reply to: How to validate the special characters in a record
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: 1714
Location: UK

PostPosted: Sun May 27, 2012 3:36 am    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Mon May 28, 2012 7:02 am    Post subject:
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    Post subject: Re: How to validate the special characters in a record
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts sort with previous record anatol DFSORT/ICETOOL 9 Thu Oct 06, 2016 2:36 am
No new posts Get Record count in summary record fo... Atul Banke DFSORT/ICETOOL 21 Fri Sep 23, 2016 4:17 pm
No new posts Change date (DD/MM/YY) in 2nd record ... uday kiran DFSORT/ICETOOL 12 Wed Sep 07, 2016 10:57 pm
No new posts Using 'parm' to vary SORTOUT record v... Sysaron DFSORT/ICETOOL 13 Wed Sep 07, 2016 9:24 pm


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