|   | 
	 
  
    | 
RSS Feed - WebSphere MQ Support
 | 
RSS Feed - Message Broker Support
 |   
 
  
	     | 
	 | 
   
 
  
	|  DFDL not accepting large numbers | 
	« View previous topic :: View next topic »  | 
   
  
  	
	  
		
		
		  | Author | 
		  Message
		 |  
		
		  | EnOne | 
		  
		    
			  
				 Posted: Thu Nov 20, 2014 11:28 am    Post subject: DFDL not accepting large numbers | 
				     | 
			   
			 
		   | 
		 
		
		    Centurion
 
 Joined: 09 Oct 2002 Posts: 101 Location: Kansas City 
  | 
		  
		    
			  
				Using IBM Broker 8.0.0.4 I have build a DFDL using a COBOL copy book and the values are
 
 
   
	| Code: | 
   
  
	
 
               05  FIRSTVALUE
 
                                          PIC +9(11).9(4).
 
               05  SECONDVALUE
 
                                          PIC +9(11).9(4).
 
               05  THIRDVALUE
 
                                          PIC +9(10).9(5).
 
 | 
   
 
 
 
this was the DFDL created
 
 
   
	| Code: | 
   
  
	
 
            <xsd:element default=" " dfdl:length="17" name="FIRSTVALUE">
 
              <xsd:annotation>
 
                <xsd:appinfo source="http://www.wsadie.com/appinfo">
 
                  <initialValue kind="SPACE"/>
 
                </xsd:appinfo>
 
                <xsd:documentation>PIC +9(11).9(4) display</xsd:documentation>
 
              </xsd:annotation>
 
              <xsd:simpleType>
 
                <xsd:restriction base="dfdlCobolFmt:PIC-Numeric-Edited-Display__string">
 
                  <xsd:maxLength value="17"/>
 
                </xsd:restriction>
 
              </xsd:simpleType>
 
            </xsd:element>
 
            <xsd:element default=" " dfdl:length="17" name="SECONDVALUE">
 
              <xsd:annotation>
 
                <xsd:appinfo source="http://www.wsadie.com/appinfo">
 
                  <initialValue kind="SPACE"/>
 
                </xsd:appinfo>
 
                <xsd:documentation>PIC +9(11).9(4) display</xsd:documentation>
 
              </xsd:annotation>
 
              <xsd:simpleType>
 
                <xsd:restriction base="dfdlCobolFmt:PIC-Numeric-Edited-Display__string">
 
                  <xsd:maxLength value="17"/>
 
                </xsd:restriction>
 
              </xsd:simpleType>
 
            </xsd:element>
 
            <xsd:element default=" " dfdl:length="17" name="THIRDVALUE">
 
              <xsd:annotation>
 
                <xsd:appinfo source="http://www.wsadie.com/appinfo">
 
                  <initialValue kind="SPACE"/>
 
                </xsd:appinfo>
 
                <xsd:documentation>PIC +9(10).9(5) display</xsd:documentation>
 
              </xsd:annotation>
 
              <xsd:simpleType>
 
                <xsd:restriction base="dfdlCobolFmt:PIC-Numeric-Edited-Display__string">
 
                  <xsd:maxLength value="17"/>
 
                </xsd:restriction>
 
              </xsd:simpleType>
 
            </xsd:element> | 
   
 
 
 
the problem is that if the input is any larger than
 
   
	| Code: | 
   
  
	
 
<FirstNumber>9999999.9999</FirstNumber>
 
<SecondNumber>9999999.9999</SecondNumber>
 
<ThirdNumber>99999.99999</ThirdNumber> | 
   
 
 
 
I get 
 
 
   
	| Code: | 
   
  
	
 
05   490    17 NUMB      FIRSTVALUE       +00000000INFINITY
 
05   507    17 NUMB      SECONDVALUE      +00000000INFINITY
 
05   524    17 NUMB      THIRDVALUE       +00000000INFINITY
 
 | 
   
 
 
when it should accept two 11 digit numbers with 4 numbers after the decimal point and a 10 digit number with 5 numbers after the decimal point like this.
 
   
	| Code: | 
   
  
	
 
<FirstNumber>99999999999.9999</FirstNumber>
 
<SecondNumber>99999999999.9999</SecondNumber>
 
<ThirdNumber>9999999999.99999</ThirdNumber> | 
   
 
 | 
			   
			 
		   | 
		 
		
		  | Back to top | 
		  
		  	
		   | 
		 
		
		    | 
		 
		
		  | EnOne | 
		  
		    
			  
				 Posted: Thu Nov 20, 2014 12:09 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		 
		
		    Centurion
 
 Joined: 09 Oct 2002 Posts: 101 Location: Kansas City 
  | 
		  
		    
			  
				  
 
 
not a DFDL issue a coding issue
 
 
BEFORE
 
   
	| Code: | 
   
  
	      SET OutputRecord.FIRSTVALUE ='+' || LeftPad('0000000000000000',CAST(CAST(InputCredit.FirstNumber AS DECIMAL(11,4)) AS CHAR)); -- PIC +9(11).9(4).
 
      SET OutputRecord.SECONDVALUE='+' || LeftPad('0000000000000000',CAST(CAST(InputCredit.SecondNumber AS DECIMAL(11,4)) AS CHAR)); -- PIC +9(11).9(4).
 
      SET OutputRecord.THIRDVALUE ='+' || LeftPad('0000000000000000',CAST(CAST(InputCredit.ThirdNumber AS DECIMAL(10,5)) AS CHAR)); -- PIC +9(10).9(5).
 
 | 
   
 
 
 
AFTER
 
   
	| Code: | 
   
  
	      SET OutputRecord.FIRSTVALUE ='+' || LeftPad('0000000000000000',CAST(CAST(InputCredit.FirstNumber AS DECIMAL(17,4)) AS CHAR)); -- PIC +9(11).9(4).
 
      SET OutputRecord.SECONDVALUE='+' || LeftPad('0000000000000000',CAST(CAST(InputCredit.SecondNumber AS DECIMAL(17,4)) AS CHAR)); -- PIC +9(11).9(4).
 
      SET OutputRecord.THIRDVALUE ='+' || LeftPad('0000000000000000',CAST(CAST(InputCredit.ThirdNumber AS DECIMAL(17,5)) AS CHAR)); -- PIC +9(10).9(5).
 
 | 
   
 
 | 
			   
			 
		   | 
		 
		
		  | Back to top | 
		  
		  	
		   | 
		 
		
		    | 
		 
		
		  | 
		    
		   | 
		 
	   
	 | 
   
 
  
	     | 
	 | 
	Page 1 of 1 | 
   
 
 
 
  
  	
	  
		
		  
 
  | 
		  You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
  | 
  		 
	   
	 | 
   
 
  	 | 
	  |