ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

RNQ0103 target too small

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

  • RNQ0103 target too small

    Hi All;

    I'm converting some of my fixed format programs to free format.

    Some of my numeric fields have "hidden meaning".

    For example control number is CCYYMMDD-STAMP. In fixed format I was able to z-add control number into stamp with the high order positions being truncated.

    Other than a data structure is there any way to get around the RNQ0103 error (The target for a numeric operation is too small to hold the result) and extract only the stamp?

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

  • #2
    Re: RNQ0103 target too small

    Code:
    try %subdt(timestamp: *HOURS) + %subdt(timestamp: *MINUTES) ...etc
    For a timestamp: *MSECONDS, *SECONDS, *MINUTES, *HOURS, *DAYS, |*MONTHS, and *YEARS |


    kinda funny

    Code:
    c                   eval      ISODate = %Date()      
    c                   eval      TimeStamp  = %Timestamp()    
    
    c                   eval      TheUnique = 'Cit' + %editc(@JOB#:'X') +        
    c                             %char(  %Subdt(ISODate:*Years))  +             
    c                             %char(  %Subdt(ISODate:*Months))  +            
    c                             %char(  %Subdt(ISODate:*Days))    +            
    c                             %char(  %Subdt(Timestamp:*Hours))   +          
    c                             %char(  %Subdt(TimeStamp:*Minutes)) +          
    c                             %char(  %Subdt(TimeStamp:*Seconds)) +          
    c                             %char(  %Subdt(TimeStamp:*MS))                 
     *
    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: RNQ0103 target too small

      Thanks Jamie:

      I thought my post was a little confusing.

      It's not a time stamp its a sequence stamp. 20080214000001 thru 20080214000482 represents stamps 1 thru 482 done today 2/14/08.

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

      Comment


      • #4
        Re: RNQ0103 target too small

        Code:
        bigstring  = 20080214000001   = decimal 14
        
        date = %dec(%subst(%editc(bigstring:'X'):1:8):8:0);
        time =  %dec(%subst(%editc(bigstring:'X'):9:6):6:0);
        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


        • #5
          Re: RNQ0103 target too small

          Here's one way to do it
          Code:
               D SeqStampDS      DS
               D   SeqStamp              1     15S 0
               D   SeqDate               1      8S 0
               D   SeqNumber             9     15S 0

          Comment


          • #6
            Re: RNQ0103 target too small

            Thank You Gentlemen

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

            Comment

            Working...
            X