GRM – datget issue on a numeric field within an frl

Homepage Clovertech Forums Read Only Archives Cloverleaf Tcl Library GRM – datget issue on a numeric field within an frl

  • Creator
    Topic
  • #53791
    Andre van Olden
    Participant

    I am having an issue where the datget on a field within my .frl is always stripping leading zero’s.

    VERSION: Version 5.7 Rev2

    AIX OS Level: 6.1.0.0

    Message excerpt

    MESSAGE = B0000118399179QASTIFFLER, MARIA

    Rec_Type = B0 ( ch 2 bytes )

    Acct_Num = 000118399179 ( nm 12 bytes )

    Name = QASTIFFLER, MARIA (ch 25 bytes )

    Code snippet ( example )

    set ghIn [grmcreate -msg $mh frl name.frl]

    set outputVal [datget [grmfetch $ghIn Acct_Num] VALUE]

    In the above, outputVal always has the value with leading zero’s stripped ( in this case 118399179 )

    Is there a way to preserve / extract the whole field using GRM

    Thanks

    Andre’

Viewing 1 reply thread
  • Author
    Replies
    • #78948
      Chris Williams
      Participant

      Try redefining the DATATYPE for ACCT_NUM from “nm” to “ch”. It’s a matter of whether you treat the incoming field as a numeric value or as a string of characters. For numeric values, 00001 and 1 both equate to 1, but as character strings they are entirely different.

      It’s the same when doing comparisons in Tcl and the difference between {00001 eq 1} and {00001 == 1}

    • #78949
      Andre van Olden
      Participant

      Chris,

      Thanks for your input, but I failed to mention in the initial post that I experimented and tried all those options for datatypes in the original .frl that defines the record layout.

      Regardless of ch, nm, ai……the leading zero’s are always stripped on the fetch.

      I just setup the test again, to make sure I was not dreaming and alas ! still strips them

Viewing 1 reply thread
  • The forum ‘Tcl Library’ is closed to new topics and replies.

Forum Statistics

Registered Users
5,129
Forums
28
Topics
9,301
Replies
34,448
Topic Tags
288
Empty Topic Tags
10