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
 

 

TnT: edit masks

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Java & MQSeries
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    Post subject: TnT: edit masks
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    IBMMAINFRAMES.com Support Forums -> Java & MQSeries All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Use of Edit & FTOV migusd SYNCSORT 3 Wed Jun 08, 2016 1:49 am
No new posts How storage is calculated for AN-Edit... Raghu navaikulam COBOL Programming 2 Wed Mar 09, 2016 3:51 pm
No new posts Too many edit macro's and too few PF ... don.leahy TSO/ISPF 7 Wed Feb 17, 2016 3:00 am
No new posts EDIT END(SAVE) or CANCEL? Steve Coalbran TSO/ISPF 9 Sat Feb 06, 2016 7:11 pm
No new posts How to create/edit/update a new GDG V... karthikbalakumar8 JCL & VSAM 2 Fri Feb 05, 2016 6:35 pm


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