IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Problem in MOVE statement


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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
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: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu Mar 12, 2009 5:42 pm
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
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
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
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: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu Mar 12, 2009 6:12 pm
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
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: 1353
Location: Israel

PostPosted: Thu Mar 12, 2009 6:38 pm
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
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
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: 2146
Location: At my coffee table

PostPosted: Thu Mar 12, 2009 7:03 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts COBOL - Move S9(11)v9(7) COMP-3 to -(... COBOL Programming 5
No new posts How to move the first field of each r... DFSORT/ICETOOL 5
No new posts JOIN STATEMENT PERFORMANCE. DFSORT/ICETOOL 12
No new posts z/vm installation problem All Other Mainframe Topics 0
Search our Forums:

Back to Top