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
 

 

Problem in MOVE statement

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

New User


Joined: 02 May 2008
Posts: 42
Location: chennai

PostPosted: Thu Mar 12, 2009 5:27 pm    Post subject: Problem in MOVE statement
Reply with quote

Hi,

In my cobol program the below line is showing the error.

MOVE 99.9 TO ATTENUATOR-FACTOR OF ACCES-LIAISON.

ERROR:
The "MOVE" statement was invalid. Expected "TO", but found ".".
statement was discarded.
"9" was invalid. Skipped to the next verb, period or procedure-name definition.

Sathish
Back to top
View user's profile Send private message

Craq Giegerich

Senior Member


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

PostPosted: Thu Mar 12, 2009 5:40 pm    Post subject:
Reply with quote

Show the line before the move and what is the definition of ATTENUATOR-FACTOR OF ACCES-LIAISON.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7989
Location: Bellevue, IA

PostPosted: Thu Mar 12, 2009 5:42 pm    Post subject:
Reply with quote

What is the PICTURE clause for ATTENUATOR-FACTOR OF ACCES-LIAISON?
Back to top
View user's profile Send private message
sathish1760

New User


Joined: 02 May 2008
Posts: 42
Location: chennai

PostPosted: Thu Mar 12, 2009 5:46 pm    Post subject:
Reply with quote

Thanks for your reply.
my definition is:
Code:
01  ACCES-LIAISON.                         
    02  CODE-VALIDITE-SECTION   PIC X.     
    02  VALEUR-DE-ACCES         PIC 9(4). 
    02  INDICATEUR-LIAISON      PIC X.     
    02  NUMERO-SOUSSYSTEME-COTEA           
                                PIC 9(4). 
    02  NUMERO-SOUSSYSTEME-COTEB           
                                PIC 9(4). 
    02  DATE-DEBUT-VALIDITE     PIC 9(8). 
    02  DATE-FIN-VALIDITE       PIC 9(8). 
    02  STATUS-CD               PIC X(2). 
    02  RELATION-IND            PIC X(1). 
    02  NE-VALUE                PIC X(16).
    02  ATTENUATOR-FACTOR       PIC 9(2)V9.
    02  FILLER                  PIC X(12).

and the previous line is:
Code:
MOVE SPACES TO RELATION-IND OF ACCES-LIAISON. 
MOVE WA-EQPA-ACC-FROM-IN TO                   
             NE-VALUE OF ACCES-LIAISON.       
MOVE 99.9  TO ATTENUATOR-FACTOR OF ACCES-LIAISON.
Back to top
View user's profile Send private message
Mathiv Anan

Active User


Joined: 23 Jul 2008
Posts: 106
Location: USA

PostPosted: Thu Mar 12, 2009 5:49 pm    Post subject:
Reply with quote

i am suggesting this without knowing the PIC clause.

Please use 99.9 within quotes.
or else,
Since it is a constant value, define a variable in working storage and set the value as 99.9.

Then use that variable for move statement.
Back to top
View user's profile Send private message
sathish1760

New User


Joined: 02 May 2008
Posts: 42
Location: chennai

PostPosted: Thu Mar 12, 2009 6:01 pm    Post subject:
Reply with quote

Mathive,

since it is delared as numeric,I cant use quotes.

Is it possible to overcome that issue without adding one new variable?

thanks,
sathish
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7989
Location: Bellevue, IA

PostPosted: Thu Mar 12, 2009 6:12 pm    Post subject:
Reply with quote

Why do you think you can't use quotes if the variable is declared numeric? Which compiler are you using?

I tested using Enterprise COBOL 3.4.1 and got:
Code:
          05 WS-NUMERIC-VAR              PIC 99V9   VALUE ZEROS.
     /
      PROCEDURE DIVISION.
      S1000-MAIN       SECTION.
          MOVE 99.9                   TO  WS-NUMERIC-VAR.
          DISPLAY  WS-NUMERIC-VAR.

          MOVE '999'                  TO  WS-NUMERIC-VAR.
          DISPLAY  WS-NUMERIC-VAR.
which generated output of
Code:
 999
 990
so the problem is either the compiler you're using or something in the way you're writing the code.
Back to top
View user's profile Send private message
Mathiv Anan

Active User


Joined: 23 Jul 2008
Posts: 106
Location: USA

PostPosted: Thu Mar 12, 2009 6:22 pm    Post subject:
Reply with quote

yes me tested too. (Ecob)

you can just move 99.9 to that variable. or even use qoutes.

i think you would need to check system installation.
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1226
Location: Israel

PostPosted: Thu Mar 12, 2009 6:38 pm    Post subject: Reply to: Problem in MOVE statement
Reply with quote

I copied your code into a program, compiled and got everything OK.
Just for fun I added one space like this:
Code:
MOVE 99. 9 TO ATTENUATOR-FACTOR OF ACCES-LIAISON.

and got the same 2 error messages that you got.
Maybe you had a typo somewhere ??
Back to top
View user's profile Send private message
Mathiv Anan

Active User


Joined: 23 Jul 2008
Posts: 106
Location: USA

PostPosted: Thu Mar 12, 2009 6:47 pm    Post subject:
Reply with quote

icon_biggrin.gif ho great. then that should be the problem.
Back to top
View user's profile Send private message
sathish1760

New User


Joined: 02 May 2008
Posts: 42
Location: chennai

PostPosted: Thu Mar 12, 2009 6:58 pm    Post subject:
Reply with quote

hi all,

I tried the same line with a simple program, it is working.

But in the main program it is not working.I guess the problem is with the coding.I will check.Thanks
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Thu Mar 12, 2009 7:03 pm    Post subject: Re: Problem in MOVE statement
Reply with quote

sathish1760 wrote:
Code:
MOVE 99.9 TO ATTENUATOR-FACTOR OF ACCES-LIAISON.

ERROR:
The "MOVE" statement was invalid.  Expected "TO", but found ".".
statement was discarded.
"9" was invalid.  Skipped to the next verb, period or procedure-name definition.
How about posting the actual listing (like above) but several lines above and below?
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 Problem reading GTF trace output danik56 ABENDS & Debugging 7 Thu Mar 16, 2017 1:02 pm
No new posts ROUNDED Problem with COMPUTE statement shalem COBOL Programming 11 Thu Feb 09, 2017 8:16 pm
No new posts VALIDATE NULL VALUE IN DB2 CASE STATE... useit DB2 5 Thu Feb 09, 2017 4:34 pm
No new posts DB2 9.1.0 not move values to Host-Var... Miguel Fernandez DB2 8 Wed Jan 25, 2017 8:24 pm
No new posts DB2 9.1.0 not move values to Host-Var... Miguel Fernandez DB2 0 Wed Jan 25, 2017 8:23 pm


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