IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

TnT: edit masks


IBM Mainframe Forums -> Java & MQSeries
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Ralph Zbrog

New User


Joined: 21 Nov 2009
Posts: 58
Location: California

PostPosted: Mon Jan 25, 2010 2:13 pm
Reply with quote

There have been no postings for a while, so here's a tidbit from my Tips'n'Techniques collection.

A LOGICAL variable can have only one of two values: False or True, represented internally as H'00' and H'01', respectively. On a typical report or form, you would expect to see a blank or 'X', and that's how Natural displays them by default.

Here is a very simple program to display Natural's default values. Note that even integers (0 in the right-most bit) are considered "false" and odd integers (1 in the right-most bit) are considered "true".

Code:
DEFINE DATA LOCAL
1 #I (I1)          1 REDEFINE #I
  2 #L (L)
END-DEFINE
FOR #I = 1 5
  DISPLAY #I
          #L
END-FOR
END

And here is the output:
Code:
 #I  #L
---- --

   1 X
   2
   3 X
   4
   5 X

The Xs in the #L column represent "true". Using an edit mask, it's a very simple matter to make reports more self-explanatory.

Add a simple edit mask
Code:
  DISPLAY #I
          #L (EM=F/T)

to get
Code:
 #I  #L
---- --

   1 T
   2 F
   3 T
   4 F
   5 T

Get a little fancier and more legible with
Code:
  DISPLAY #I
          #L (EM=/TRUE)


 #I   #L
---- ----

   1 TRUE
   2
   3 TRUE
   4
   5 TRUE

Use quoted strings for mixed case:
Code:
  DISPLAY #I
          #L (EM=/'True')


 #I   #L
---- ----

   1 True
   2
   3 True
   4
   5 True

Of course the logical need not be limited to True and False.
Code:
  DISPLAY #I
          #L (EM='Even'/'Odd')


 #I   #L
---- ----

   1 Odd
   2 Even
   3 Odd
   4 Even
   5 Odd
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Java & MQSeries

 


Similar Topics
Topic Forum Replies
No new posts Query on edit primary command CLIST & REXX 5
No new posts Query on edit primary command CLIST & REXX 1
No new posts Need help to resolve a hard edit COBOL Programming 8
This topic is locked: you cannot edit posts or make replies. Need help to resolve a hard edit COBOL Programming 4
No new posts create rexx edit Macro that edits the... CLIST & REXX 3
Search our Forums:

Back to Top