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
 

 

Help with a MOVE statement

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
avinashgup

New User


Joined: 03 Aug 2007
Posts: 19
Location: Naperville

PostPosted: Fri Apr 04, 2008 7:49 am    Post subject: Help with a MOVE statement
Reply with quote

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
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Apr 04, 2008 8:04 am    Post subject:
Reply with quote

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
View user's profile Send private message
the_gautam

Active User


Joined: 05 Jun 2005
Posts: 165
Location: Bangalore

PostPosted: Fri Apr 04, 2008 10:49 am    Post subject:
Reply with quote

MOVE " //DEMAND EXEC FORCE,PARM='NODACHK' '' TO TEST1-RECORD.
Back to top
View user's profile Send private message
avinashgup

New User


Joined: 03 Aug 2007
Posts: 19
Location: Naperville

PostPosted: Fri Apr 04, 2008 10:58 am    Post subject: Great! Both the solutions worked for me
Reply with quote

Thanks folks! Both the solutions worked for me. I tried both and they worked.
Back to top
View user's profile Send private message
Phrzby Phil

Active Member


Joined: 31 Oct 2006
Posts: 962
Location: Richmond, Virginia

PostPosted: Fri Apr 04, 2008 6:08 pm    Post subject:
Reply with quote

Another common way to handle embedded single quotes is to enter them twice:

MOVE 'JOE''S BOOK' TO VAR.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Fri Apr 04, 2008 6:27 pm    Post subject:
Reply with quote

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
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Fri Apr 04, 2008 6:30 pm    Post subject:
Reply with quote

That's what Avinash did, except he forgot to add the closing quote that pairs with '//DEMAND....
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Apr 04, 2008 7:14 pm    Post subject:
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. How to move a long alphanumeric data ... lind sh COBOL Programming 8 Mon Dec 05, 2016 7:51 pm
No new posts -913/-911 Deadlock during UPDATE stat... NoSleep319 DB2 5 Fri Nov 18, 2016 12:37 am
No new posts Protection Exception while move 0 to ... Kevin Vaz CICS 10 Tue Oct 18, 2016 4:19 pm
No new posts COBOL DB2 - CALL statement - high CPU... TS70363 DB2 15 Sun Sep 11, 2016 6:07 am
No new posts Converting NULL column into NOT NULL ... Raghu navaikulam DB2 5 Sat Aug 06, 2016 3:45 pm


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