时间戳错误

时间:2017-02-02 05:33:18

标签: ibm-midrange rpgle

因此,在我们的Production iSeries中,其中一个程序运行正常的错误。

     Statement in Error . . . . . . . . . . :   00051900
 RPG Routine  . . . . . . . . . . . . . :   REPROMIS
 Number of Parameters . . . . . . . . . :   005
 Message Type . . . . . . . . . . . . . :   RNX
 Additional Message Info  . . . . . . . :   0114
 Message Data . . . . . . . . . . . . . :
              The year portion of a Date or Timestamp value is not in the correct range.

以上是错误。所以我理解错误的声明是519,这是

RepromiseMode();

所以这只是在iSeries程序中调用的过程。正如我在之前的一篇文章中提到的,我仍在学习如何读取假脱机文件。我已经查看了Job日志,下面是我认为可能与我想的相关的内容:

Message . . . . :   Data mapping error on member FG205L01.                    
 Cause . . . . . :   A data mapping error occurred on field                    
   Max(FG205F_1.QSRDTE) in record number 0, record format *FIRST, member number
   1, in member FG205L01 file FG205L01 in library FILES, because of error code 
   18. The error code meanings follow: 1 -- There is data in a decimal field   
   that is not valid. 2 -- A significant digit was truncated. 3 -- A floating  
   point value exceeded the maximum representable value. 4 -- A floating point 
   value was less than the minimum representable value. 5 -- A binary floating 

如上所述,错误代码18为:

18 - 日期,时间或时间戳字段中的数据无效。

现在有点困惑如何向前迈进。这只是一个数据问题,还是需要代码更改的程序相关问题?

下面是放置假脱机文件的保管箱链接。

https://www.dropbox.com/s/1jbgqvqn9zaac8g/PD001R_Error.txt?dl=0

任何有关如何前进的指导都会有所帮助

**

  

更新 - 1

**

因此,就我迄今为止所做的研究而言,我需要专注于以下程序

P RepromiseMode   B

      // ...... Define the procedure interface
     D RepromiseMode   PI

      /Free
       //- Spin the whole file
        CallP  PW012R('INFO':'PD001R0055':ModuleName:' ':
                        ' ':' ':' ':'0':' ':P_COMOrd:P_ItmSeq:
                        ' ':' ':' ':' ':' ');
        If  P_COMOrd = *Blanks;
          Setll (*Loval) PD002F;
          Read  PD002F;
        Else;
          If  P_ItmSeq = *Zeros;
            Setll  (1:'1':P_COMOrd) PD002F;
            Reade  (1:'1':P_COMOrd) PD002F;
          Else;
            Setll  (1:'1':P_COMOrd:%Dec(P_ItmSeq:7:0)) PD002F;
            Reade  (1:'1':P_COMOrd:%Dec(P_ItmSeq:7:0)) PD002F;
          EndIf;
        EndIf;

        Dow  Not %Eof(PD002F);
          wOrdCmp  = E_A2AENB;
          wOrdTyp  = E_A2DCCD;
          wOrdNbr  = E_A2CVNB;
          wItmSeq  = E_A2FCNB;
          wModel   = E_A2MODL;
          hldInvDt = E_A2INVD;
          hldBldDt = E_A2BLDA;
          hldQuaDt = LowDate;
          hldTrnDt = LowDate;
          hldShpDt = LowDate;
          hldPrmDt = LowDate;
          MoreDates = *Off;
GAC03     NextRecord = *Off;

GAC11  //- Check if it is the correct repromise
GAC11     CorrectOrd = *Off;
GAC11     Exec Sql
GAC11       Select '1' into :CorrectOrd
GAC11       From mbc6res0
GAC11       Inner Join pd001f On a1ordy=c6uucc And a1adr0=c6uuca
GAC11       where c6aenb=:wOrdCmp And c6dccd=:wOrdTyp
GAC11             And c6cvnb=:wOrdNbr And a1dvnm=:ModuleName;
GAC11     If  SqlCode > 100;
GAC11       // Actually nothing yet if error then it will not run past here
GAC11     EndIf;

GAC11  //- If the record is for this repromise continue
GAC11     If  CorrectOrd;

       //- Conitune if the PD002F is written
          GetInvDate();
          If  PD002Good;
            Chain (wOrdCmp:wOrdTyp:wOrdNbr:wItmSeq) FG263L02;
            If  %Found(FG263L02);
              Chain (K_FGVIN#) FG203F;
              If  %Found(FG203F);
                If  hldBldDt > *Loval;
                  wInventoryDt = hldBldDt;
                Else;
                  wInventoryDt = %Date();
                EndIf;

       //- Shippable is Yes
                If  V_SHIP = 'Y';
                  wFinGood = 'Y';
                  wSalFmy  = V_SFMLY;
                  wPline   = V_PLINE;
                  wHouse   = V_CHOUSE;
                  ProcRePromise();
                  GetPD002F();

       //- Shippable is NO
                Else;
                  CallP  PW012R('INFO':'PD001R0090':ModuleName:V_CHOUSE:
                                V_VIN:V_MODEL:' ':%Char(V_ORDCMP):V_ORDTYP:
                                V_ORDNBR:'0':' ':' ':' ':' ':' ');
                  LoopDone = *On;
                  wFinGood = 'Y';
                  wSalFmy  = V_SFMLY;
                  wPline   = V_PLINE;
                  wHouse   = V_CHOUSE;
                  ProcRepromise();
                  GetPD002F();
                EndIf;

GAC03  //- Some how there is a valid vin in FG263F but not FG203F then...
GAC03         Else;
GAC04           CallP  PW012R('INFO':'PD001R0210':ModuleName:' ':
GAC04                         K_FGVIN#:' ':' ':%Char(wOrdCmp):wOrdTyp:
GAC04                         wOrdNbr:%Char(wItmSeq):' ':' ':' ':' ':' ');
GAC03           SendEmail = *On;
GAC04           GetPD009F();
              EndIf;

       //- No VIN was found
            Else;
              Chain (wOrdCmp:wOrdtyp:wOrdNbr:wItmSeq) PW019L01;
              If  %Found(PW019L01);

       //- Found in PW019F and it is a Finshed Good VIN
                If  N_B0FASG = 'Y';

       //- End the process the order has not been assigned in the warehouse
       //   yet, but there is a label waiting for assignment all is good.
                  CallP  PW012R('INFO':'PD001R0185':ModuleName:' ':
                              ' ':wModel:' ':%Char(wOrdCmp):wOrdtyp:wOrdNbr:
                              %Char(wItmSeq):' ':' ':' ':' ':' ');

                Else;

       //- Looks for a slot record
                  Chain (wOrdCmp:wOrdtyp:wOrdNbr:wItmSeq) PW014F;
                  If  %Found(PW014F);
                    hldBldDt = P_B5PDAT;
                    MoreDates = *On;

       //- No slot record look for a MO order
                  Else;
                    Chain (wOrdCmp:wOrdtyp:wOrdNbr:wItmSeq) MOMASTLG;
                    If  %Found(MOMASTLG);
                      hldBldDt = %Date(M_ODDTMY:*CYMD);
                      MoreDates = *On;

       //- No MO record send an error email
                    Else;
                      CallP  PW012R('INFO':'PD001R0170':ModuleName:' ':
                              ' ':wModel:' ':%Char(wOrdCmp):wOrdtyp:wOrdNbr:
                              %Char(wItmSeq):' ':' ':' ':' ':' ');
                      SendEmail = *On;
GAC04                 GetPD009F();
                    EndIf;
                  EndIf;
                EndIf;

       //- Error because not in PW019F
              Else;
                CallP  PW012R('INFO':'PD001R0175':ModuleName:' ':
                              ' ':wModel:' ':%Char(wOrdCmp):wOrdtyp:wOrdNbr:
                              %Char(wItmSeq):' ':' ':' ':' ':' ');
                SendEmail = *On;
GAC04           GetPD009F();
              EndIf;

       //- If there needs to be more dates calculate
              If  MoreDates;
                GetSalesFamly();
                P_NumDays = *Zeros;
                wModel = E_A2MODL;
                CallP PD005R(wSalFmy:' ':wModel:P_NumDays);
                DecNumDays = %Dec(P_NumDays:4:0);
                If  DecNumDays = *Hival;
                  CallP  PW012R('INFO':'PD001RE025':ModuleName:' ':
                              ' ':wModel:' ':%Char(wOrdCmp):wOrdtyp:wOrdNbr:
                              %Char(wItmSeq):'PD005R came back with 9999 days':
                              ' ':' ':' ':' ');
                  SendEmail  = *On;
                  NextRecord = *On;
                  GetPD009F();
                Else;
                  Chain (1:'1':wOrdNbr:wItmSeq) MBCDRES0;
                  If  %Found(MBCDRES0);
                    wHouse = B_CDA3CD;
                    Chain (1:'1':wOrdNbr:wItmSeq) MOMASTLG;
                    If  %Found(MOMASTLG);
                      Chain (M_FIWHMY) WHSMST;
                      If  %Found(WHSMST);

       //- Move forward number of days agains work cacendar
                        CYMDDate = %Dec(%Char(hldBldDt:*CYMD0):7:0);
                        Setll (W_CALP:CYMDDate) CALNDRL0;
                        For  j = 0 to DecNumDays;
                          Reade (W_CALP) CALNDRL0;
                          CYMDDate = CDTECA;
                        EndFor;
                      EndIf;

       //- Now update the Quality Date
                      hldBldDt = %Date(CYMDDate:*CYMD);
                      wInventoryDt = hldBldDt;
                      CallP  PW012R('INFO':'PD001R0125':ModuleName:' ':
                                  ' ':wModel:' ':%Char(wOrdCmp):wOrdtyp:wOrdNbr:
                                    %Char(wItmSeq):' ':' ':' ':' ':' ');
                      GetPD002F();
                    EndIf;
GAC05             Else;
GAC05  // DO not send email on this because the file is empty
GAC05               CallP  PW012R('INFO':'PD001R0230':ModuleName:wHouse:
GAC05                           ' ':' ':' ':'0':' ':wOrdNbr:%Char(wItmSeq):
GAC05                           ' ':' ':' ':' ':' ');
GAC05               NextRecord = *On;
                  EndIf;

       //- Get all the dates needed
                  wFinGood = 'N';
                  If  Not NextRecord;
                    QualityDate();
                    CallP  PW012R('INFO':'PD001R0140':ModuleName:' ':' ':wModel:
                              ' ':%Char(wOrdCmp):wOrdtyp:wOrdNbr:%Char(wItmSeq):
                              ' ':' ':' ':' ':' ');
                  EndIf;

                  If  Not NextRecord;
                    TransferDate();
                    CallP  PW012R('INFO':'PD001R0122':ModuleName:' ':' ':wModel:
                              ' ':%Char(wOrdCmp):wOrdtyp:wOrdNbr:%Char(wItmSeq):
                              ' ':' ':' ':' ':' ');
                  EndIf;
                  If  Not NextRecord;
                    ShipWedgeDate();
                    CallP  PW012R('INFO':'PD001R0123':ModuleName:' ':' ':wModel:
                              ' ':%Char(wOrdCmp):wOrdtyp:wOrdNbr:%Char(wItmSeq):
                              ' ':' ':' ':' ':' ');
                    GetPD002F();
                  EndIf;
                EndIf;
              EndIf;
            EndIf;
          EndIf;
GAC11     EndIf;

          If  P_COMOrd = *Blanks;
            Read  PD002F;
          Else;
            If  P_ItmSeq = *Zeros;
              Reade  (1:'1':P_COMOrd) PD002F;
            Else;
              Reade  (1:'1':P_COMOrd:%Dec(P_ItmSeq:7:0)) PD002F;
            EndIf;
          EndIf;
        EndDo;

      /End-Free

     P RepromiseMode   E

我正在调试此功能,但到目前为止还没有崩溃,以确定哪个日期分配/日期相关操作导致问题。

  

更新 - 2

在上述过程中,正在读取文件PD002F。要查看具有日期数据类型的所有字段的日期值,我尝试使用CLient访问中的“导出”选项将此文件解压缩到Excel,但随后抛出了相同的错误:

CWBDB0099 - No more data is available for the stream fetch request

SQL0181 - Value in date, time, or timestamp string not valid.

Cause . . . . . :   The string representation of a date, time or timestamp value is not in the acceptable range.  *N is either the character string constant that is not valid or the column or host variable that contained the string.

文件损坏还是什么?

  

更新-3

我尝试使用RRN提取一条记录< 2通过客户端访问,它工作正常!但是当我给RRN< 3,抛出同样的错误。这进一步加深了我的怀疑,即这个问题仅针对特定记录而出现。

  

更新4

以下是转储中的违规数据以及相关的日期操作:

hldInvDt = E_A2INVD; 
hldBldDt = E_A2BLDA; 
hldQuaDt = LowDate; 
hldTrnDt = LowDate; 
hldShpDt = LowDate; 
hldPrmDt = LowDate; 
wInventoryDt = hldBldDt; 
wInventoryDt = %Date(); 
hldBldDt = P_B5PDAT; 
hldBldDt = %Date(M_ODDTMY:*CYMD); 
CYMDDate = %Dec(%Char(hldBldDt:*CYMD0):7:0); 
hldBldDt = %Date(M_ODDTMY:*CYMD); 
CYMDDate = %Dec(%Char(hldBldDt:*CYMD0):7:0); 
CYMDDate = CDTECA; 
hldBldDt = %Date(CYMDDate:*CYMD);

HLDINVDT     DATE(10)    '2017-02-10' 
E_A2INVD     DATE(10)    '2017-02-10' 
LOWDATE      DATE(10)    '0001-01-01' 
HLDQUADT     DATE(10)    '0001-01-01' 
HLDTRNDT     DATE(10)    '0001-01-01' 
HLDSHPDT     DATE(10)    '0001-01-01' 
HLDPRMDT     DATE(10)    '0001-01-01' 
WINVENTORYDT DATE(10)    '2017-02-10' 
P_B5PDAT     DATE(10)    '0017-02-10' 
WINVENTORYDT DATE(10)    '2017-02-10' 
HLDBLDDT     DATE(10)    '0017-02-10' 
M_ODDTMY     PACKED(7,0) 1170210. 
CYMDDATE     ZONED(7,0)  1170210 
CDTECA       PACKED(7,0) 1170126

1 个答案:

答案 0 :(得分:1)

IBM i在日期字段中使用了多种日期格式。它们根据日期的年份部分格式保存不同的日期范围。

Number of Digits in Year               Range of Years
2 (*YMD, *DMY, *MDY, *JUL)             1940 to 2039
3 (*CYMD, *CDMY, *CMDY)                1900 to 2899
4 (*ISO, *USA, *EUR, *JIS, *LONGJUL)   0001 to 9999

您收到的错误表示您尝试将年份为4位的日期移至年份为2或3位数的日期,并且年份值超出了目标日期的范围。在这种情况下,特定罪犯似乎是hldBldDt,在错误发生时,0017年,并且可能是*ISO格式。有几个地方你这样做:

CYMDDate = %Dec(%Char(hldBldDt:*CYMD0):7:0); 

我怀疑其中一个引发了您的错误,因为hldBldDt中的0017*CYMD*CYMD超出范围(hldBldDt的允许范围是1900年) - 2899)。问题是,由于*CYMD通常使用P_B5PDAT填充,因此来自何处,并且应该将日期保持在范围内。查看数据后,我发现0017也有一年P_B5PDAT,并且您将hldBldDt直接分配给P_B5PDAT。所以如果一直运行良好,text = dwg.add(svgwrite.text.Text("")) text.add(svgwrite.text.TextPath(path=w, text="blab blab bla bal", startOffset=None, method='align', spacing='exact')) 中的值没有被使用,或者某种程度上你在那里度过了糟糕的一年。