- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- dcl substitution
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
04-20-2006 08:02 AM
04-20-2006 08:02 AM
dcl substitution
$ WRITE WRITELINE "(TO_DATE("'"''END_CUR_MON'"'", 'YYYYMMDD'));"
and it produces:
(TO_DATE(", 'YYYYMMDD')) AND
(TO_DATE(", 'YYYYMMDD'));
what I need it to write is out put like the following:
(TO_DATE('03/01/2006', 'MM/DD/YYYY')) AND
(TO_DATE('03/31/2006', 'MM/DD/YYYY'));
I am uncertain as how to set up a sysmbol with ascii value - any advice would be greatly appreciated
thanks in advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2006 08:39 AM
04-20-2006 08:39 AM
Re: dcl substitution
$ dd=f$cvtime(,,"DAY") ! day as a string
$ mm=f$cvtime(,,"MONTH") ! month as a string
$ yyyy=f$cvtime(,,"YEAR") ! year as a string
$ WD=F$FAO("TO_DATE(''''!AS-!AS-!AS'''', MM/DD/YYYY)",mm,dd,yyyy)
$! The result
$ sho symb wd
WD = "TO_DATE('04-20-2006', MM/DD/YYYY)"
which can be used to create the string to write.
OpenVMS Developer & System Manager
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2006 09:00 AM
04-20-2006 09:00 AM
Re: dcl substitution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2006 09:03 AM
04-20-2006 09:03 AM
Re: dcl substitution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2006 05:07 PM
04-20-2006 05:07 PM
Re: dcl substitution
to insert a ' character you may have to split the WRITE into several parts, see the attached example (I've attached an example in order to better distinguish between " and ''.
regards alle
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2006 01:16 AM
04-21-2006 01:16 AM
Re: dcl substitution
$ WRITE WRITELINE "(TO_DATE(""''BEG_CUR_MON'"",""YYYYMMDD"")) AND "
$ WRITE WRITELINE "(TO_DATE(""''END_CUR_MON'"",""YYYYMMDD""));"
There's a space between the "AND" and the double quote. (Gotta love this stupid short textbox...)
The double single quotes before and single single quote after cause symbol substitution within the WRITE command, and the double double quotes cause a single double quote to be written in the output. (Got that? ;-)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2006 01:21 AM
04-21-2006 01:21 AM
Re: dcl substitution
This: "(TO_DATE(
is followed by two double quotes and two single quotes.
BEG_CUR_MON
is followed by one single quote and two double quotes, a comma, and two double quotes.
YYYYMMDD
is followed by two double quotes, two close parens, a space, the word AND, and a double quote.
Follow the same pattern in the 2nd statement.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2006 07:36 AM
04-21-2006 07:36 AM
Re: dcl substitution
23 TO_DATE(TO_CHAR(P.POST_DATE, 'YYYYMMDD'), 'YYYYMMDD') BETWEEN
24 (TO_DATE("20060401","YYYYMMDD")) AND
25 (TO_DATE("20060430","YYYYMMDD"));
(TO_DATE("20060430","YYYYMMDD"))
I need single quotes and I've tried numerous combinations - yours was very close -and I very much appreciate your attempt to assist
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2006 08:49 PM
04-21-2006 08:49 PM
Re: dcl substitution
the postings using single, double, and/or doubkle-single quotes in the forum display are VERY confusing.
They become MUCH clearer if you cut-and-paste them into some fixed-font editor, such as (being VMS :-) ) TPU or EDT. But *UX vi or even M$ notepad are also well suited.
On building complex, multi-quoted lines, I usually get results easiest by either using a symbol where I want that character to appear, or by having one write with multiple concatenated strings.
Example of the latter"
$ WRITE LINE """" + "XYZ''some_symbol'" + """blablabla" + ....(etc)
hth
Proost.
Have one on me (maybe in May in Nashua?)
jpe
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2006 10:03 AM
04-22-2006 10:03 AM
Re: dcl substitution
Normally you can output a single quote by just writing a single quote.
Two adjacent single quotes are the intro for a string substitution request: ''var'
A third single quote finishes this sequence, whether the variable name was found or not or even absent.
Your dcl gets specifically tricky because that simple simple single quote meant to be output, gets 'eaten' by the two single quotes leading in the variable name to be substituted.
I actually think there may be a bug in this space in DCL, but would recommend simply not going there for maintainability and readability reason. The solution then is to just concatenate the pieces of string with variables using either a + sign in an assignment statement.
In a write statement you can actually choose between + and ,
They have the same effect, but work differently.
As Karl suggests:
$ WRITE WRITELINE "(TO_DATE('","''BEG_CUR_MON'","','DD/MM/YYYY'))"
And that works, but is a still a little hard to read.
May I suggest a construction like:
write x "string", variable, "other string"
In your example:
$write WRITELINE " (TO_DATE('", BEG_CUR_MON, "', 'MM/DD/YYYY')) AND"
$write WRITELINE " (TO_DATE('", END_CUR_MON, "', 'MM/DD/YYYY'));"
because you have commas in your strings I would suggest using the +
$write WRITELINE " (TO_DATE('" + BEG_CUR_MON + "', 'MM/DD/YYYY')) AND"
$write WRITELINE " (TO_DATE('" + END_CUR_MON + "', 'MM/DD/YYYY'));"
Regards,
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2006 03:49 AM
05-04-2006 03:49 AM
Re: dcl substitution
will get you the first piece.
Hope this helps
-john
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2006 03:52 AM
05-04-2006 03:52 AM
Re: dcl substitution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2006 01:36 AM
05-05-2006 01:36 AM
Re: dcl substitution
Define two symbols, one for a single quote and one for a double quote, then use those when needed, instead of trying to figure out the right number of single or double quotes needed to produce on one the output.
Example:
$!
$! This is a sample command procedure which
$! demonstrates how to include single and double
$! quotes into a string
$!
$ single_quote :== "'
$ double_quote :== """
$ write sys$output single_quote
$ write sys$output double_quote
$ write sys$output "this string has a single quote (",single_quote,") and double quote (", double_quote,") in it"
$ new_sym = "this new string has a single quote (" + single_quote + ") "
$ new_sym = new_sym + "and double quote (" + double_quote + ") in it also."
$ write sys$output new_sym
The sample procedure is also attached.
Ken
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2006 11:05 AM
05-05-2006 11:05 AM
Re: dcl substitution
'xcept that I use the symbols "q" and "qq" :-).
Hein.