| View previous topic :: View next topic | 
	
	
		| Author | Message | 
	
		| Nabanita Das Beginner
 
 
 Joined: 09 Nov 2005
 Posts: 33
 Topics: 10
 
 
 | 
			
				|  Posted: Wed Nov 09, 2005 8:16 am    Post subject: COBOL datatype |   |  
				| 
 |  
				| Can anyone please explain why thi s happens? 
 Suppose I am defining 2 variables as
 
 01 DT-value.
 05 DT-VAL1               pic 999.9.
 01 HA-DT-VAL               pic 999.9.
 
 and in the procedure division
 
 Move DT-VAL1 to HA-dt-val.
 
 If I use DT-VAL1 as 0aa.0 HA-dt-val is dispalyed as 011.0.Why?
 
 Please explain this datatype 999.9 also.
 Thanks
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| kolusu Site Admin
 
  
 
 Joined: 26 Nov 2002
 Posts: 12394
 Topics: 75
 Location: San Jose
 
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| ikumar Beginner
 
 
 Joined: 09 Nov 2005
 Posts: 6
 Topics: 3
 
 
 | 
			
				|  Posted: Wed Nov 09, 2005 9:46 am    Post subject: |   |  
				| 
 |  
				| Because you are moving an alphabetic value to the numeric data item, system stores the data in zoned decimal numbers and the corresponding value for A is 1, in when it interpret the alphabetic value. 
 correct me if i am wrong...
 
 Thanks,
 Kumar.
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| ANIL SARATHY Beginner
 
  
 Joined: 30 Aug 2005
 Posts: 88
 Topics: 3
 Location: Syracuse,New york
 
 | 
			
				|  Posted: Thu Nov 10, 2005 12:08 am    Post subject: |   |  
				| 
 |  
				| hex representation of  0aa.0    is  'F0C1C14BF0'. 
 
 In zone decimal every byte has 0-3 bits for sign ( f - unsigned , C - positive , d -negative ) and 4 -7 bits for numeric value
 
 
 that is why HA-DT-VAL has 011.0 .
 _________________
 Anil Sarathy
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		|  | 
	
		|  |