Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Condition Name with Set

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
RamsIBM

New User


Joined: 08 Jan 2007
Posts: 53
Location: Chennai

PostPosted: Sat Jul 19, 2008 11:15 pm    Post subject: Condition Name with Set
Reply with quote

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
View user's profile Send private message

Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Sat Jul 19, 2008 11:28 pm    Post subject: Re: Condition Name with Set
Reply with quote

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 icon_wink.gif

Regards,

Bill
Back to top
View user's profile Send private message
RamsIBM

New User


Joined: 08 Jan 2007
Posts: 53
Location: Chennai

PostPosted: Sat Jul 19, 2008 11:42 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Sun Jul 20, 2008 12:02 am    Post subject: Re: Condition Name with Set
Reply with quote

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
View user's profile Send private message
RamsIBM

New User


Joined: 08 Jan 2007
Posts: 53
Location: Chennai

PostPosted: Sun Jul 20, 2008 12:23 am    Post subject:
Reply with quote

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
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Sun Jul 20, 2008 1:21 am    Post subject: Re: Condition Name with Set
Reply with quote

Perhaps another member will jump in with an explanation, because I've run out of ways to explain this.... icon_confused.gif

Bill
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Sun Jul 20, 2008 2:16 am    Post subject:
Reply with quote

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
View user's profile Send private message
RamsIBM

New User


Joined: 08 Jan 2007
Posts: 53
Location: Chennai

PostPosted: Sun Jul 20, 2008 2:27 am    Post subject:
Reply with quote

Since I got the access I tried in my system and I understood Thanks
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Joinkeys with condition scdinesh DFSORT/ICETOOL 10 Tue Feb 14, 2017 12:20 am
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm
No new posts INCLUDE condition questions van bui DFSORT/ICETOOL 1 Thu Jun 30, 2016 9:52 am
No new posts 2 vsam file compare and update a fiel... ABINAYATHULASI DFSORT/ICETOOL 6 Sun May 29, 2016 11:15 am
No new posts File matching using specific condition mf_karthik DFSORT/ICETOOL 3 Fri Nov 20, 2015 11:04 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us