- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- wildcard expressions in DCL script
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2004 02:27 AM
01-29-2004 02:27 AM
if var .eqs. "bob*" then goto A
Looking to use wildcard in an if statement.
Thanks in advance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2004 02:31 AM
01-29-2004 02:31 AM
Re: wildcard expressions in DCL script
wildcard works only with files (command DIR or lex F$SEARCH).
I wrote a C routine to manage LIKE operator; if you have a C compiler I can send you source code.
Bye
Antoniov
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2004 02:41 AM
01-29-2004 02:41 AM
Re: wildcard expressions in DCL script
- Perl for Vms
http://www.sidhe.org/vmsperl/
- awk (in Tcpip examples, snmp subdirectory, you have gawk)
- Python for Vms
vmspython.dyndns.org
all have regular expression matching, in python
import re
re.compile...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2004 02:52 AM
01-29-2004 02:52 AM
Re: wildcard expressions in DCL script
I did the following to get what I wanted.
if f$extract(0,3,VAR) .eqs. "BOB" then goto
better than nothing and works..
Much appreciative.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2004 03:25 AM
01-29-2004 03:25 AM
Re: wildcard expressions in DCL script
load this simple like routine written in DCL. It's very simple but can help you.
Bye
Antoniov
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2004 03:26 AM
01-29-2004 03:26 AM
SolutionYour extract and compare is the classic solution, but the most rigid as the string must be in an exact location.
Most folks will use F$LOCATE comparing the result with F$LENGTH to get at the "*string" leading wildcard effect.
There are also creative usages of F$ELEMENT for stirng locating.
And there is yet an other, not too well known, method to check for string matches in DCL through string subtraction (reduction)!
$ test = "xxxxABCyyyy"
$ if test .eqs. (test - "ABC") then write sys$output "Not found"
$ if test .eqs. (test - "ABCD") then write sys$output "Not found"
Not found
$ x = test - "ABC"
$ show symb x
X = "xxxxyyyy"
$
Here is an other (a bit more widespread used)string subtract example:
$ write sys$output f$cvt() -
-" "-"-"-"-"-":"-":"-":"-"."
2004012911245313
Enjoy!
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2004 03:27 AM
01-29-2004 03:27 AM
Re: wildcard expressions in DCL script
Bye
Antoniov
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2004 03:47 AM
01-29-2004 03:47 AM
Re: wildcard expressions in DCL script
Thanks to everyone.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2004 09:06 AM
02-02-2004 09:06 AM
Re: wildcard expressions in DCL script
a variation on
$ if f$extract(0,3,VAR) .eqs. "BOB" then goto A
would be
$ var=f$edit(var,"trim,compress,upcase")
$ if f$extract(0,3,VAR) .eqs. "BOB" then goto A
this gives me a level of predictability when it comes to leading spaces, multiple space/tabs, and upper/lower case.
hope it helps.
john
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2004 08:49 PM
02-02-2004 08:49 PM
Re: wildcard expressions in DCL script
$ if f$extract(0,3,f$edit(var,"trim,compress,upcase") .eqs. "BOB" then goto A
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2004 01:40 PM
04-04-2004 01:40 PM
Re: wildcard expressions in DCL script
Another thought. How about using f$locate..
$ aa = "****BOB###"
$ bb = f$locate("BOB",aa)
$ sh symb bb
BB = 4 Hex = 00000004 Octal = 00000000004
$ bb = f$locate("BILL",aa)
$ sh symb bb
BB = 10 Hex = 0000000A Octal = 00000000012
$
The result being the string location if found, else its length if not found.
Regards
Simon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2004 08:38 PM
04-04-2004 08:38 PM
Re: wildcard expressions in DCL script
http://www.openvms.org/stories.php?story=03/03/31/6547431
Purely Personal Opinion