ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Display file Field

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Display file Field

    Hi,

    I have display file field say 'Name'. I have defined as Alpha numeric. Now in this field I should not enter Numeric Values. If I enter the field should not accept the value and need to through an error.

    Since the field is defined as 10 A it is acceting the Numeric inputs also. Now the question is how to restrict the Numeric Values? It needs program level change of Display file level Change?

    Thanks
    Muthu
    Miles to Go, Before I sleep.

  • #2
    Re: Display file Field

    PHP Code:
    d chardata        s               n                                     
    d chr5            s              5                                      
    d sqldata3        s              5                                      
     
    *                                                                      
     /
    free                                                                  
                                                                            
          sqldata3 
    '01A35';                                               
          
    chr5 = %subst(sqldata3:1:5);                                      
          if %
    check('0123456789 'chr5) > *zeros;     // char data found   
           
    chardata = *on;                                                  
          endif;                                                            
                                                                            
                                                                            
          *
    inlr = *on;                                                      
     /
    end-free 
    All my answers were extracted from the "Big Dummy's Guide to the As400"
    and I take no responsibility for any of them.

    www.code400.com

    Comment


    • #3
      Re: Display file Field

      Hi mksamy_99

      From the DDS Reference...Display files
      http://publib.boulder.ibm.com/iserie...f/rzahfms1.htm under "data type"

      Alphabetic Only (X)

      Both types of keyboards are in lowershift. Only the characters A through Z, comma (,), period (.), dash (-), and space ( ) can be typed in. When you type lowercase characters a through z, uppercase characters are sent to the program. See CHECK (Check) keyword for display files for an explanation of how to permit typing in lowercase characters for the typewriter-like keyboard on the 5250 work station.
      Best of Luck
      GLS
      The problem with quotes on the internet is that it is hard to verify their authenticity.....Abraham Lincoln

      Comment


      • #4
        Re: Display file Field

        I've always preferred checking the data in the program (like Jamie's example) rather than thru the display file in these situations. Since the field in the file can be updated via other methods than simply the display file, you'll need to be able to monitor / control those other methods as well.
        Michael Catalani
        IS Director, eCommerce & Web Development
        Acceptance Insurance Corporation
        www.AcceptanceInsurance.com
        www.ProvatoSys.com

        Comment


        • #5
          Re: Display file Field

          Originally posted by MichaelCatalani View Post
          I've always preferred checking the data in the program (like Jamie's example) rather than thru the display file
          Agreed ..... Just pointing out an alternative

          GLS
          The problem with quotes on the internet is that it is hard to verify their authenticity.....Abraham Lincoln

          Comment


          • #6
            Re: Display file Field

            How about of using field level RANGE keyword in display file?

            Comment


            • #7
              Re: Display file Field

              Originally posted by ravikiran032 View Post
              How about of using field level RANGE keyword in display file?
              first let me say...why are drudging up posts that are months old?

              secondly, validating on the display file itself is a major irritant to most users (and myself i absolutely HATE DDS validation). why inhibit the screen, require hitting reset, and force your users to squint at the status bar on the emulator?) using a MSGSFL or a simple message field on the screen itself is much better IMO. easier on the eyes (especially for those of us with bad eyesight), less keystrokes, able to display a much more descriptive message, etc. i wouldn't recommend using DDS validation for anything at all, users get confused enough already.
              I'm not anti-social, I just don't like people -Tommy Holden

              Comment

              Working...
              X