| View previous topic :: View next topic | 
	
	
		| Author | Message | 
	
		| ha.rajamohamed Beginner
 
 
 Joined: 29 Jan 2006
 Posts: 71
 Topics: 22
 
 
 | 
			
				|  Posted: Thu Nov 16, 2006 6:56 am    Post subject: Spaces in Numeric filed |   |  
				| 
 |  
				| Hi.. 
 When I read my input file Numeric filed of 10 bytes.. 9(10) .. I am receiving "      1000"... first few bytes are spaces and numeric values comes in...
 When I validate the field for Numeric.. its failing since spaces are there..
 
 There are 500+ fileds.. where I can't use Inspect..replace option...
 Is there any other way to remove to the spaces and take only the numeric portion...
 
 Thanks in advance...
 
 Raja Mohamed
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| shekar123 Advanced
 
 
 Joined: 22 Jul 2005
 Posts: 528
 Topics: 90
 Location: Bangalore India
 
 | 
			
				|  Posted: Thu Nov 16, 2006 7:55 am    Post subject: |   |  
				| 
 |  
				| ha.rajamohamed, 
 Can you explain what are you trying to do ? Are u reading from a File into a record structure declared as say X(80) and that structure is divided into subfields.
 
 Can you post you sample input file contents and the cobol record structure ?
 _________________
 Shekar
 Grow Technically
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| ha.rajamohamed Beginner
 
 
 Joined: 29 Jan 2006
 Posts: 71
 Topics: 22
 
 
 | 
			
				|  Posted: Thu Nov 16, 2006 8:52 am    Post subject: |   |  
				| 
 |  
				| Hi,, The input file length is 18000....
 We are reading in to a copy book layout... contains these Numeric fields..
 If we receives it in a alphanumeric fileds it not a issue,
 The issue is.. while we reading .. in the Numeric fileds. It contains spaces in it...
 example..
 in 9(10)... the values is "        11"... Eight spaces followed by 2 numeric values...
 Now I need only the last two numeric values.. how to supress the spaces...
 
 Thanks
 Raja Moahamed
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| shekar123 Advanced
 
 
 Joined: 22 Jul 2005
 Posts: 528
 Topics: 90
 Location: Bangalore India
 
 | 
			
				|  Posted: Thu Nov 16, 2006 9:12 am    Post subject: |   |  
				| 
 |  
				| ha.rajamohamed, 
 
 I am still not clear about the requirement but what my understanding goes the way below:
  	  | Code: |  	  | A 9(10)
 B 9(02)
 
 J = 1
 
 PERFORM VARYING I FROM 1 BY 1 UNTIL I > 10
 IF A(I:1) EQUAL SPACES
 CONTINUE
 ELSE
 MOVE(I:1) TO B(J:1)
 ADD +1 TO J
 END-IF
 END-PERFORM
 | 
 _________________
 Shekar
 Grow Technically
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| kolusu Site Admin
 
  
 
 Joined: 26 Nov 2002
 Posts: 12394
 Topics: 75
 Location: San Jose
 
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| ha.rajamohamed Beginner
 
 
 Joined: 29 Jan 2006
 Posts: 71
 Topics: 22
 
 
 | 
			
				|  Posted: Thu Nov 16, 2006 10:38 am    Post subject: |   |  
				| 
 |  
				| Kolusu... Thanks..... it working fine with NUMVAL....
 Thanks shekar.. for the information....
 
 Regards
 Raja Mohamed
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		|  | 
	
		|  |