What is SET TO TRUE all about, anyway?

In COBOL II the 88 levels can be set rather than moving their associated values to the related data item. (Web note: This change is not one of COBOL II's better specifications.)

Showing Answers 1 - 16 of 16 Answers

Azahar

  • Dec 14th, 2005
 

The set to true is done for 88 level variables to set that flag

For eg: 05 ws-change-flag    pic x(1).

              88 ws-chg       value 'Y'

              88 ws-no-chg   value 'N'

when set ws-chg  to true is done then ws-change-flag  contains value 'Y'  .It is same as move 'Y' to ws-change-flag     

If the statement is set ws-no-chg to true then ws-change-flag    contains value 'N'.It is same is move 'N' to ws-change-flag   

At one point of time only one flag can be set.

  Was this answer useful?  Yes

chetan patel

  • Jan 8th, 2007
 

no it is not like that.

            if in a level no. 88 if there is more than one one condition then if i want to true only first condition then we use SET TO TRUE condition.for example-

                                77 ws-status pic x(8).

                                 88 married-value "1" "2" "3".

                          Then if i want  to true only first condition i.e (1) then in a PROCEDURE DIVISION you just give a statement-

                             married-value set to true.

  Was this answer useful?  Yes

poojaDeep

  • Apr 16th, 2008
 

no, its not like that..according to me first answer is right..!

e.g. 05  ACCOUNT-TYPE         PIC X(01) VALUE 'N'.
             88  PREPAID-ACCT                     VALUE 'Y'.
             88  POSTPAID-ACCT                  VALUE 'Y'.

Use this in:-

SET POSTPAID-ACCT  TO TRUE 

This will set the post paid value to Y.

SET PREPAID-ACCT  TO TRUE  - THIS WILL SET PREPAID=Y


Last answer is correct and below example also.
e.g. 05  ACCOUNT-TYPE         PIC X(01) VALUE 'N'.
             88  PREPAID-ACCT                     VALUE 'Y'.
             88  POSTPAID-ACCT                  VALUE 'Y'.

Use this in:-

SET POSTPAID-ACCT  TO TRUE 

This will set the post paid value to Y.

SET PREPAID-ACCT  TO TRUE  - THIS WILL SET PREPAID=Y

  Was this answer useful?  Yes

Nath

  • Sep 13th, 2013
 

@poojaDeep & @gilbat82,

As you said, I have three doubts.

1. While starting execution of the program after declaring in working storage as you said, what are the initial values (TRUE or FALSE) are set for ACCOUNT-TYPE, PREPAID-ACCT and POSTPAID-ACCT variables?

2. As per your declaration, what the value assign for ACCOUNT-TYPE after SET PREPAID-ACCT TO TRUE. is it Y or N? Same for POSTPAID-ACCT setting also.

3. Once we set TRUE for POSTPAID-ACCT or PREPAID-ACCT, what flag (T or F) is assigns for other? Suppose in program first time you assigned TRUE for POSTPAID-ACCT, then what flag assign for PREPAID-ACCT? After some statement in the program, if you assign TRUE for PREPAID-ACCT, then what flag is available for POSTPAID-ACCT and finally what the value is available for ACCOUNT-TYPE?

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions