View previous topic :: View next topic
|
Author |
Message |
sathish1760
New User
Joined: 02 May 2008 Posts: 42 Location: chennai
|
|
|
|
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 |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
Show the line before the move and what is the definition of ATTENUATOR-FACTOR OF ACCES-LIAISON. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
What is the PICTURE clause for ATTENUATOR-FACTOR OF ACCES-LIAISON? |
|
Back to top |
|
|
sathish1760
New User
Joined: 02 May 2008 Posts: 42 Location: chennai
|
|
|
|
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 |
|
|
Mathiv Anan
Active User
Joined: 23 Jul 2008 Posts: 106 Location: USA
|
|
|
|
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 |
|
|
sathish1760
New User
Joined: 02 May 2008 Posts: 42 Location: chennai
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
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
so the problem is either the compiler you're using or something in the way you're writing the code. |
|
Back to top |
|
|
Mathiv Anan
Active User
Joined: 23 Jul 2008 Posts: 106 Location: USA
|
|
|
|
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 |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
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 |
|
|
Mathiv Anan
Active User
Joined: 23 Jul 2008 Posts: 106 Location: USA
|
|
|
|
ho great. then that should be the problem. |
|
Back to top |
|
|
sathish1760
New User
Joined: 02 May 2008 Posts: 42 Location: chennai
|
|
|
|
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 |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
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 |
|
|
|