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

Any built in function to find out spl char used or not


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
bnrinbox

New User


Joined: 15 Feb 2005
Posts: 4

PostPosted: Fri Apr 28, 2006 4:40 pm
Reply with quote

As per my requirement i have to check any spl char used as data or not in a string. Is there any built-in function available? Please let me know. If no builtin function available, let me know, how to find through code?

Thanks alot
Back to top
View user's profile Send private message
ravi1

New User


Joined: 27 Apr 2006
Posts: 11

PostPosted: Wed May 03, 2006 7:00 pm
Reply with quote

bnrinbox wrote:
As per my requirement i have to check any spl char used as data or not in a string. Is there any built-in function available? Please let me know. If no builtin function available, let me know, how to find through code?

Thanks alot


I think You can find the special character in a string using INDEX function.

DCL DATA1 BIN(31,0) INIT(0);
DCL STRING1 CHAR(10);
STRING1 = 'ADCF@EFGHI';
DATA1 = INDEX(STRING1,'@');
IF DATA1 = 0
THEN PUT SKIP LIST('SPECIAL CHARACTER NOT FOUND');
PUT SKIP LIST('DATA1:', DATA1);

HERE DATA1 WILL RETURN '5' SINCE @ IS PRESENT IN THE 5TH POSITION OF THE STRING.
Back to top
View user's profile Send private message
k_vikram07

New User


Joined: 23 Nov 2005
Posts: 35

PostPosted: Fri Jun 09, 2006 5:22 pm
Reply with quote

YOu can use VERIFY to check the existance of SPL characters.

DCL specialchar char(12) INIT('!@#$%^&*()_+}{|"icon_confused.gif><');

DCL input CHAR(15);

IF VERIFY(input,specialchar) = 0
THEN /* there is no special character in input variable*/;
ELSE
/* special character used */;

You can include any character, you think is special, in the init of the specialchar variable. See usage of VERIFY for more info.

-Vik.
Back to top
View user's profile Send private message
k_vikram07

New User


Joined: 23 Nov 2005
Posts: 35

PostPosted: Fri Jun 09, 2006 5:24 pm
Reply with quote

Sorry, the function is SEARCH not VERIFY.


-Vik
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 -> PL/I & Assembler

 


Similar Topics
Topic Forum Replies
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Calling an Open C library function in... CICS 1
No new posts Exclude rows with > than x occurre... DFSORT/ICETOOL 6
No new posts DATE2 function SYNCSORT 15
Search our Forums:

Back to Top