View previous topic :: View next topic
|
Author |
Message |
Harshavardhana
New User
Joined: 09 Mar 2007 Posts: 7 Location: India
|
|
|
|
Hi Friends,
I want to store the ' "WELCOME" ' into a WORKING-STORAGE variable.
Suppose, the variable is
01 VAR-1 PIC X(10).
How can I store with the quotes included? |
|
Back to top |
|
|
Harshavardhana
New User
Joined: 09 Mar 2007 Posts: 7 Location: India
|
|
|
|
Another Example :
I want to store the following string:
BMEDPAC= 'HQDEVA.BASE.' into the following variable.
01 VAR-1 PIC X(32).
How to do this. Please help. |
|
Back to top |
|
|
agkshirsagar
Active Member
Joined: 27 Feb 2007 Posts: 691 Location: Earth
|
|
|
|
Quote: |
MOVE QUOTES TO VAR-1(1:1) VAR-1(10:1)
MOVE 'WELCOME' TO VAR-1(2:9) |
But there should be a more elegant way!
I will search a bit now |
|
Back to top |
|
|
sudhaaa
New User
Joined: 24 Mar 2005 Posts: 51
|
|
|
|
Can you try with below move statements (Worked for me)
77 A PIC X(20).
77 B PIC X(20).
MOVE '"WELCOME"' TO A
MOVE '''HQDEVA.BASE.''' TO B |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
You could also to this with the STRING statement. |
|
Back to top |
|
|
sudhaaa
New User
Joined: 24 Mar 2005 Posts: 51
|
|
|
|
Can I request you to post a bit of code for this.. it will be helpful for me |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
I believe this will do what you want:
Code: |
MOVE SPACES TO VAR-1.
STRING QUOTE
'HQDEVA.BASE.'
QUOTE DELIMITED BY '\'
INTO VAR-1.
|
Good luck and let us know if this does not do what you need |
|
Back to top |
|
|
|