|   | 
	 
  
    | 
RSS Feed - WebSphere MQ Support
 | 
RSS Feed - Message Broker Support
 |   
 
  
	     | 
	 | 
   
 
  
	|  Discriminators for two fields | 
	« View previous topic :: View next topic »  | 
   
  
  	
	  
		
		
		  | Author | 
		  Message
		 |  
		
		  | mqbrks | 
		  
		    
			  
				 Posted: Thu Mar 30, 2017 7:05 am    Post subject: Discriminators for two fields | 
				     | 
			   
			 
		   | 
		 
		
		   Voyager
 
 Joined: 17 Jan 2012 Posts: 75
  
  | 
		  
		    
			  
				Hi All,
 
 
I have trouble parsing my file with DFDL using discriminators. Here are the details.
 
 
I have a file with 
 
 
1 Header Record
 
MultipleDataRecords 
 
Data_1 
 
        Data1a
 
        Data1b
 
        Data1c
 
Data_2
 
        Data2a
 
        Data2b
 
        Data2c
 
Data_3 
 
        Data3a
 
        Data3h
 
        Data3k
 
 
Each of the individual data records (like data1a,data1b....) have fields based on which I want to discriminate the data. 
 
 
At the sequence of each data records (data1a,Data1b....) I have a discriminator like {./DataType eq '2' and ./DataCode2A eq 'A'}
 
 
But these doesn't parse the data correctly, I am getting a parsing exception saying "fatal: CTDP3002E: Unexpected data found at offset '546' after parsing completed. Data: '0x52...'."
 
 
Any ideas if I am doing a wrong way of writing the discriminator expressions ?  Does IIB DFDL model solve two test conditions in a record. 
 
 
Your inputs please!
 
 
Appreciate your help! | 
			   
			 
		   | 
		 
		
		  | Back to top | 
		  
		  	
		   | 
		 
		
		    | 
		 
		
		  | timber | 
		  
		    
			  
				 Posted: Thu Mar 30, 2017 3:03 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		 
		
		    Grand Master
 
 Joined: 25 Aug 2015 Posts: 1292
  
  | 
		  
		    
			  
				Post an example of your input data.
 
Post the message tree structure that you want to get after parsing it
 
Then, explain *very* carefully what you want the DFDL parser to do when it encounters each record.
 
 
Use [c o d e] tags when posting any code or data. | 
			   
			 
		   | 
		 
		
		  | Back to top | 
		  
		  	
		   | 
		 
		
		    | 
		 
		
		  | mqjeff | 
		  
		    
			  
				 Posted: Fri Mar 31, 2017 4:57 am    Post subject:  | 
				     | 
			   
			 
		   | 
		 
		
		   Grand Master
 
 Joined: 25 Jun 2008 Posts: 17447
  
  | 
		  
		    
			  
				Do you expect each record to appear in exactly the sequence you have listed?
 
 
Or will you have a choice of records, that repeats? _________________ chmod  -R ugo-wx / | 
			   
			 
		   | 
		 
		
		  | Back to top | 
		  
		  	
		   | 
		 
		
		    | 
		 
		
		  | mqbrks | 
		  
		    
			  
				 Posted: Fri Mar 31, 2017 6:37 am    Post subject:  | 
				     | 
			   
			 
		   | 
		 
		
		   Voyager
 
 Joined: 17 Jan 2012 Posts: 75
  
  | 
		  
		    
			  
				Thank you kimbert and mqjeff!!
 
 
There was issue in one of the record( a field was missing) so that was causing the whole issue of total record length. When I corrected it the discriminators and parsing worked fine. Now I am able to parse the records and discriminate them perfectly. | 
			   
			 
		   | 
		 
		
		  | 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
  | 
  		 
	   
	 | 
   
 
  	 | 
	  |