| View previous topic :: View next topic | 
	
	
		| Author | Message | 
	
		| sat Beginner
 
 
 Joined: 23 Jan 2006
 Posts: 8
 Topics: 3
 
 
 | 
			
				|  Posted: Mon Jan 23, 2006 3:29 pm    Post subject: Numeric to Alpha-Numeric in ISPF panel |   |  
				| 
 |  
				| Hi, 
 I have a numeric input field in my ISPF panel. The input is being validated as:
 
 VER(&SERIALNO),NB,MSG=I01111P)
 VER(&SERIALNO),NUM,MSG=I01112P)
 
 
 Now, there is a change to this existing panel. The Serialno field is being changed to alpha-numeric from Numeric.
 Also, the alpha-numeric input has to be upper case only.
 
 So, my questions are:
 
 1) How will the above code change, if the field is changed to alpha-numeric. Is it as simple as, just removing the second statement above. Therefore, the code will look as:
 
 VER(&SERIALNO),NB,MSG=I01111P)
 
 
 2) Do I need to code specifically for Upper case inputs only? How to take care if the user inputs lower-case inputs? Will the MVS session take care of this or do i have to code soemthing for this? If I have to code, please assist how the code will look like?
 
 Thanks
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| German Castillo Beginner
 
  
 Joined: 23 Dec 2005
 Posts: 83
 Topics: 2
 Location: Caracas, Venezuela
 
 | 
			
				|  Posted: Mon Jan 23, 2006 3:42 pm    Post subject: |   |  
				| 
 |  
				| Hello sat, 
 There is no keyword for Upper-Case, however there are several more for what may be called 'alphanumeric', for example NAME will validate upper-lowercase plus special characters, you may even place a PICT keyword, like VER(&SERIALNO,PICT, CCC-CCCC), C stands for Character, N for numeric and there existes several others 'Wild Cards'
 
 I suggest you to get hold of ISPF Dialog Guide Manual, which has a lot of usefull information, not only on Panel definitions, but also in building ISPF applications as well
 _________________
 Best wishes,
 
 German Castillo
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| sat Beginner
 
 
 Joined: 23 Jan 2006
 Posts: 8
 Topics: 3
 
 
 | 
			
				|  Posted: Mon Jan 23, 2006 4:15 pm    Post subject: |   |  
				| 
 |  
				| Hi, 
 I started going thru the reference book on ISPF panels. It doesnot list any keyword for checking alphanumeric. As mentioned above, I thought of using PICT, but it also will not work for me. My variable field is 5 bytes.
 
 Is there a way or logic to check that each of the byte of this 5 byte variable is one of A-Z or 0-9.
 
 Appreciate any other best approach too. Would be great if someone provide with a sample code.
 
 Thanks
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| German Castillo Beginner
 
  
 Joined: 23 Dec 2005
 Posts: 83
 Topics: 2
 Location: Caracas, Venezuela
 
 | 
			
				|  Posted: Mon Jan 23, 2006 4:20 pm    Post subject: |   |  
				| 
 |  
				| Did you try ALPHA? It won't accept spaces tho. Try Also ALPHAB. I think that one option allows spetial characters such as "#$%&/ while the other not _________________
 Best wishes,
 
 German Castillo
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| sat Beginner
 
 
 Joined: 23 Jan 2006
 Posts: 8
 Topics: 3
 
 
 | 
			
				|  Posted: Mon Jan 23, 2006 4:26 pm    Post subject: |   |  
				| 
 |  
				| I tried ALPHA also. It takes A-Z, a-z, #, @ and $. So it doesnot help.  Still looking for the best solution 
 Thanks
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| German Castillo Beginner
 
  
 Joined: 23 Dec 2005
 Posts: 83
 Topics: 2
 Location: Caracas, Venezuela
 
 | 
			
				|  Posted: Mon Jan 23, 2006 4:29 pm    Post subject: |   |  
				| 
 |  
				|  	  | German Castillo wrote: |  	  | .... Try Also ALPHAB. I think that one option allows spetial characters such as "#$%&/ while the other not | 
 _________________
 Best wishes,
 
 German Castillo
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| sat Beginner
 
 
 Joined: 23 Jan 2006
 Posts: 8
 Topics: 3
 
 
 | 
			
				|  Posted: Mon Jan 23, 2006 8:00 pm    Post subject: |   |  
				| 
 |  
				| ALPHAB also doesnot help, as it includes lower case letters.  I needed something that can take only A-Z and 0-9 for a 5 byte alphanumeric field. 
 Thanks
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| semigeezer Supermod
 
 
 Joined: 03 Jan 2003
 Posts: 1014
 Topics: 13
 Location: Atlantis
 
 | 
			
				|  Posted: Tue Jan 24, 2006 1:48 am    Post subject: |   |  
				| 
 |  
				|  	  | Code: |  	  | )BODY whatever _foo  +
 whatever _val  +
 whatever _bar  +
 )PROC
 /* validate that val is A-Z,0-9 only and set cursor if in error */
 &p3 = 'X'
 &p5 = 'A-Z, 0-9'
 *REXX(VAL,P3,P5)
 val = left(val,5)
 valid = 'ABCDEFGHIJKLMNOPQRSTUVWXTZ0123456789'
 i = verify(val,valid)
 if 0 < i then
 do
 P3 = i
 zrxmsg = "ISPP223"
 zrxrc=8
 end
 *ENDREXX
 if (.msg = ispp223) .cursor = val
 )END
 | 
 
 Requires z/OS 1.6 or better. Can be an external rexx  panel exit on z/OS 1.2 or higher.  Can be a non-Rexx panel exit on all supported levels of ISPF.
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| sat Beginner
 
 
 Joined: 23 Jan 2006
 Posts: 8
 Topics: 3
 
 
 | 
			
				|  Posted: Tue Jan 24, 2006 2:34 pm    Post subject: |   |  
				| 
 |  
				| Thanks ! I will take this code and will modify accordingly to suit my needs. 
 Thanks Much for all the support in Mvsforums.
 
 Best Regards
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| Mervyn Moderator
 
  
 Joined: 02 Dec 2002
 Posts: 415
 Topics: 6
 Location: Hove, England
 
 | 
			
				|  Posted: Tue Jan 24, 2006 5:41 pm    Post subject: |   |  
				| 
 |  
				| Don't forget, also, that an attribute with CAPS(ON) will automatically convert an input field to upper case. _________________
 The day you stop learning the dinosaur becomes extinct
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		|  | 
	
		|  |