Page 1 of 1

Can we use false syntax with set keyword

PostPosted: Mon May 09, 2016 2:18 pm
by arya_starc

 DATA DIVISION.                                      
 FILE SECTION.                                      
*                                                    
 WORKING-STORAGE SECTION.                            
 01  WS-VATATAR-STATUS       PIC X     VALUE 'N'.    
     88 VATATAR-STATUS       VALUE 'Y'.              
*                                                    
 PROCEDURE DIVISION.                                
     SET VATATAR-STATUS TO FALSE                                  
         DISPLAY 'ST2:' WS-VATATAR-STATUS                        
        STOP RUN.                                                
 

Re: Can we use false syntax with set keyword

PostPosted: Mon May 09, 2016 2:53 pm
by Aki88
Hello,

And what happened when you tried to compile the below code piece? Did you get a compilation error for the 'FALSE' keyword?

Also, from the good old COBOL Language Reference:
Format 4: SET for condition-names
When this form of the SET statement is executed, the value associated with a
condition-name is placed in its conditional variable according to the rules of the
VALUE clause.

Format 4: SET statement for condition-names

SET  condition-name-1 TO TRUE 
condition-name-1
Must be associated with a conditional variable.


If more than one literal is specified in the VALUE clause of condition-name-1, its
associated conditional variable is set equal to the first literal.
If multiple condition-names are specified, the results are the same as if a separate
SET statement had been written for each condition-name in the same order in
which they are specified in the SET statement.

Re: Can we use false syntax with set keyword

PostPosted: Mon May 09, 2016 3:07 pm
by arya_starc
yes i got a error message on using false syntax. below in the message
IGYPS2106-S "FALSE" WAS FOUND IN THE "SET" STATEMENT. IT WAS NOT ALLOWED IN THIS CONTEXT. THE STATEMENT WAS DISCARDED.

Re: Can we use false syntax with set keyword

PostPosted: Mon May 09, 2016 3:28 pm
by Aki88
arya_starc wrote:yes i got a error message on using false syntax. below in the message
IGYPS2106-S "FALSE" WAS FOUND IN THE "SET" STATEMENT. IT WAS NOT ALLOWED IN THIS CONTEXT. THE STATEMENT WAS DISCARDED.


As you can see, the compilation error message is self-explanatory; for further reading, refer the COBOL Language Reference snippet I'd posted earlier. That should explain why only TRUE is allowed.

Emphasis on the portion that says:

When this form of the SET statement is executed, the value associated with a
condition-name is placed in its conditional variable
according to the rules of the
VALUE clause.


In simpler terms, if you do not use 'SET - TRUE', then the group variable for the 88th level variable will not hold the value passed by the 88th level variable.

Re: Can we use false syntax with set keyword

PostPosted: Mon May 09, 2016 5:28 pm
by BillyBoyo
Enterprise COBOL does not, yet, support FALSE. There are other COBOL compilers which do.

It would be a useful addition. You can consider raising an RFE (Request For Enhancement) at https://www.ibm.com/developerworks/rfe/

IBM are keen to know what features from the COBOL 2002/2014 Standard people would find useful, so that they can schedule enhancements for future releases of Enterprise COBOL. This is an RFE which I thing would be very popular.

At the moment the general technique is to define two 88-levels, the "off" one setting to a value which does not exist in the "on".

Re: Can we use false syntax with set keyword

PostPosted: Mon May 09, 2016 10:56 pm
by arya_starc
BillyBoyo wrote:Enterprise COBOL does not, yet, support FALSE. There are other COBOL compilers which do.

It would be a useful addition. You can consider raising an RFE (Request For Enhancement) at https://www.ibm.com/developerworks/rfe/

IBM are keen to know what features from the COBOL 2002/2014 Standard people would find useful, so that they can schedule enhancements for future releases of Enterprise COBOL. This is an RFE which I thing would be very popular.

At the moment the general technique is to define two 88-levels, the "off" one setting to a value which does not exist in the "on".


Thanks billy for the link i tries to raise RFE but in registration they asking for the IBMer id and i am non-ibmer, i am not able to raise the RFE.

Re: Can we use false syntax with set keyword

PostPosted: Tue May 10, 2016 12:50 am
by enrico-sorichetti
Thanks billy for the link i tries to raise RFE but in registration they asking for the IBMer id and i am non-ibmer, i am not able to raise the RFE.


anybody can register on the IBM site,
You have to do it in order to download the manuals, and to vote on a RFE

Re: Can we use false syntax with set keyword

PostPosted: Tue May 10, 2016 3:28 am
by BillyBoyo
Yes, sorry. forgot to mention the IBM ID. It is simple, painless and free to register. There's other interesting stuff at the Developerworks generally as well.