|  | 
 
  
    | RSS Feed - WebSphere MQ Support | RSS Feed - Message Broker Support |  
 
  
	|    |  |  
  
	| Message set sequence issue while trying to restrict the len. | « View previous topic :: View next topic » |  
  	| 
		
		
		  | Author | Message |  
		  | dpu.gujjar | 
			  
				|  Posted: Wed Aug 22, 2018 5:46 am    Post subject: Message set sequence issue while trying to restrict the len. |   |  |  
		  | Newbie
 
 
 Joined: 22 Aug 2018Posts: 4
 
 
 | 
			  
				| I have designed message set as below --> Choice
 --->Sequence(1)
 -->Value1
 -->Value2
 -->Value3
 -->Value4
 
 --->Sequence(2)
 -->ValueX
 
 
 The sequence 1 has group indicator /AB- & Data Pattern as /[A][B]-([^\r]|(\r[^\n])){8,11}\r?$\n. Ideally this sequence1 should not be picked if the length of the value if less than 8 or more than 11 and it should be assigned to Sequence2. But Sequence1 is not accepting valid value when used this data patteren, and it is accepted with pattern /[A][B]-([^\r]|(\r[^\n]))* and invalid scenario more than 11 is also accepted with this.
 
 Can someone please tell me where I am going wrong
 |  |  
		  | Back to top |  |  
		  |  |  
		  | dpu.gujjar | 
			  
				|  Posted: Thu Aug 23, 2018 7:38 am    Post subject: |   |  |  
		  | Newbie
 
 
 Joined: 22 Aug 2018Posts: 4
 
 
 | 
			  
				| below is more simplified question, 
 why sequence is not restricting the length when regular expression [A-Z]{8} is used in pattern, the sequence is accepting the data that has more than 8 characters which is abruptly stopping the processing of the message set
 |  |  
		  | Back to top |  |  
		  |  |  
		  | Vitor | 
			  
				|  Posted: Thu Aug 23, 2018 7:49 am    Post subject: |   |  |  
		  |  Grand High Poobah
 
 
 Joined: 11 Nov 2005Posts: 26093
 Location: Texas, USA
 
 | 
			  
				| 
   
	| dpu.gujjar wrote: |  
	| below is more simplified question, 
 why sequence is not restricting the length when regular expression [A-Z]{8} is used in pattern, the sequence is accepting the data that has more than 8 characters which is abruptly stopping the processing of the message set
 |  
 Well a sequence is just a set of DFDL fields, but a field with a pattern of [A-Z]{8} will attempt to match that. If it's presented with a field which doesn't match that pattern, it fails (as you've discovered).
 
 So it will "restrict" the field to values which match the pattern but it will not "restrict" the values by making them conform - how could it? If it's faced with 11 lower case letters it could truncate & fold to upper case but what could it do with 8 digits? or 11 digits?
 _________________
 Honesty is the best policy.
 Insanity is the best defence.
 |  |  
		  | Back to top |  |  
		  |  |  
		  | Vitor | 
			  
				|  Posted: Thu Aug 23, 2018 7:51 am    Post subject: Re: Message set sequence issue while trying to restrict the |   |  |  
		  |  Grand High Poobah
 
 
 Joined: 11 Nov 2005Posts: 26093
 Location: Texas, USA
 
 | 
			  
				| 
   
	| dpu.gujjar wrote: |  
	| The sequence 1 has group indicator /AB- & Data Pattern as /[A][B]-([^\r]|(\r[^\n])){8,11}\r?$\n. Ideally this sequence1 should not be picked if the length of the value if less than 8 or more than 11 and it should be assigned to Sequence2. |  
 It also looks like you're trying to validate the 4 child fields of sequence one in a single pattern.
 
 I don't think that's a good idea, even if it works.
 _________________
 Honesty is the best policy.
 Insanity is the best defence.
 |  |  
		  | 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
 
 |  |  |  |