View previous topic :: View next topic
|
Author |
Message |
avinashgup
New User
Joined: 03 Aug 2007 Posts: 19 Location: Naperville
|
|
|
|
Hi,
I am trying to generate a JCL thru a COBOL program and I am writing the following MOVE statement but it gives me a error. Because the PARM field has the value in quotes and the whole statement has to be within quotes too.
MOVE '//DEMAND EXEC FORCE,PARM='NODACHK''
TO TEST1-RECORD.
Please let me know how do i correct this.
Error Message-
1701 IKF1007I-W NODACHK NOT PRECEDED BY A SPACE. ASSUME SPACE.
1701 IKF1079I-C ALPHANUMERIC LIT HAS ZERO LENGTH. ASSUME ONE SPACE.
1701 IKF1007I-W NOT PRECEDED BY A SPACE. ASSUME SPACE.
1701 IKF3001I-E NODACHK NOT DEFINED.
1701 IKF4007I-C TO MISSING OR MISPLACED IN MOVE STATEMENT. ASSUMED IN REQUIRED POSITION
1701 IKF4052I-E ALPHANUMERIC LITERAL (AN) MAY NOT BE TARGET FIELD FOR ALPHANUMERIC LITERAL (AN) IN MOVE STATEMENT, AND IS DISCARDED.
1701 IKF4008I-W SUPERFLUOUS TO FOUND IN MOVE STATEMENT. IGNORED. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello Avinash Gupta and welcome to the forums,
Quote: |
MOVE '//DEMAND EXEC FORCE,PARM='NODACHK''
TO TEST1-RECORD.
|
You have "unbalanced quotes".
Try this:
Code: |
MOVE SPACES TO TEST1-RECORD.
STRING '//DEMAND EXEC FORCE,PARM='
QUOTE
NODACHK
QUOTE DELIMITED BY '\'
INTO TEST1-RECORD. |
I'm not connect, so i've not tested this. |
|
Back to top |
|
|
the_gautam
Active User
Joined: 05 Jun 2005 Posts: 165 Location: Bangalore
|
|
|
|
MOVE " //DEMAND EXEC FORCE,PARM='NODACHK' '' TO TEST1-RECORD. |
|
Back to top |
|
|
avinashgup
New User
Joined: 03 Aug 2007 Posts: 19 Location: Naperville
|
|
|
|
Thanks folks! Both the solutions worked for me. I tried both and they worked. |
|
Back to top |
|
|
Phrzby Phil
Senior Member
Joined: 31 Oct 2006 Posts: 1042 Location: Richmond, Virginia
|
|
|
|
Another common way to handle embedded single quotes is to enter them twice:
MOVE 'JOE''S BOOK' TO VAR. |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
Phrzby Phil wrote: |
Another common way to handle embedded single quotes is to enter them twice:
MOVE 'JOE''S BOOK' TO VAR. |
That's the simplest and most straight forward way, if you have ever been taught COBOL (or most any other programming language). |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
That's what Avinash did, except he forgot to add the closing quote that pairs with '//DEMAND.... |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Yup, i almost went with the quotes and literal solution but wanted to offer a way to accomplish the task and also be able to use variables in the resulting strung value.
Quite often, jcl that i create on the fly has more than literals. . .
Hope it wasn't mis-leading. . . |
|
Back to top |
|
|
|