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
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
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    Post subject: Any built in function to find out spl char used or not
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    Post subject: Re: Any built in function to find out spl char used or not
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    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts What is the Extract Function in JCL dharmaraok JCL & VSAM 3 Wed Jun 14, 2017 9:12 am
No new posts find RACF group for access to spooled... jzhardy JCL & VSAM 1 Mon May 08, 2017 11:46 am
No new posts To find out size allocated to a seque... ashek15 JCL & VSAM 15 Thu Apr 27, 2017 9:42 am
No new posts find particular member name in PDS us... ravi243 CLIST & REXX 10 Mon Dec 19, 2016 6:44 pm
No new posts How to find the first monday of the w... abdulrafi COBOL Programming 10 Fri Nov 25, 2016 3:24 pm


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