Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 965
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
No new posts WER268A OUTREC STATEMENT : SYNTAX E... frozenblood87 SYNCSORT 12 Sat Aug 26, 2017 9:45 pm
No new posts Suppress value reported by BREAK in D... Learncoholic DFSORT/ICETOOL 3 Wed Aug 16, 2017 6:03 pm
No new posts Move from Comp3 variable to Edited Va... sreekusr COBOL Programming 8 Thu Aug 10, 2017 4:20 pm
No new posts ON 2 AND EVERY 1 - Statement ??? UmeySan COBOL Programming 2 Tue Jul 25, 2017 1:20 pm
No new posts ROUNDED Problem with COMPUTE statement shalem COBOL Programming 11 Thu Feb 09, 2017 8:16 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us