View previous topic :: View next topic
|
Author |
Message |
RamsIBM
New User
Joined: 08 Jan 2007 Posts: 53 Location: Chennai
|
|
|
|
Hi All,
In my program i have variable decalariton like this
05 SW-XXXX-INDICATOR PIC X.
88 SW-XXXX VALUE 'Y'.
88 SW-XXXX-NO VALUE 'N'.
Can you please check is these below statments is right.
if I give in any para in procdeure divionsion
Set sw-XXXX to 'Y'
or
set SW-XXX to 'N' |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
Instead of -
Code: |
Set sw-XXXX to 'Y'
or
set SW-XXX to 'N'
|
change it to -
Code: |
Set sw-XXXX to TRUE
or
set SW-XXX to TRUE
|
and all will be forgiven
Regards,
Bill |
|
Back to top |
|
|
RamsIBM
New User
Joined: 08 Jan 2007 Posts: 53 Location: Chennai
|
|
|
|
Hi Bill Thanks for your reply....
But My requirement is they want to set Y or N flag
Shall I give like this
Set sw-XXXX to 'Y'
or
set SW-XXX-No to 'N' |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
In my previous posting, the "Set sw-XXXX to TRUE" was the correct syntax (this will move a 'Y' to the SW-XXXX-INDICATOR) whereas, "Set sw-XXXX-NO to TRUE" will move an 'N' to the SW-XXXX-INDICATOR.
The ability to set 88 levels to TRUE will work, unless you're on OS/VS COBOL, which is very old.
If this is the case, then you'd have to MOVE either a 'Y' or an 'N' to SW-XXXX-INDICATOR.
The TRUE condition for 88 levels was first introduced with COBOL2 (mid/late 1980's).
Bill |
|
Back to top |
|
|
RamsIBM
New User
Joined: 08 Jan 2007 Posts: 53 Location: Chennai
|
|
|
|
I understood you explanation.
But still my doubt is
Shall we give like
Set sw-XXXX to 'Y'
or
set SW-XXX to 'N'
Is it possible to assign some values(i.e 'Y' or 'N') to condition name using SET keyword or we can assign only TRUE or FALSE value through SET statment |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
Perhaps another member will jump in with an explanation, because I've run out of ways to explain this....
Bill |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
You can move 'Y' or 'N' (or any alphanumeric value) to SW-XXXX-INDICATOR or you can SET SW-XXXX TO TRUE or SET SW-XXX-NO TO TRUE but you can not use SET with SW-XXXX-INDICATOR and for SW-XXXX and SW-XXX-NO you can only SET these to TRUE (which is the same as moving 'Y' or 'N' to SW-XXXX-INDICATOR). If SW-XXXX-INDICATOR is anything other then 'Y' or 'N" then both condition names will be false. I think that for readability you should either use the SET and the condition name tests or use the the move and equality test but don't mix them together. |
|
Back to top |
|
|
RamsIBM
New User
Joined: 08 Jan 2007 Posts: 53 Location: Chennai
|
|
|
|
Since I got the access I tried in my system and I understood Thanks |
|
Back to top |
|
|
|