MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Lowercase field reporting

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
madisand
Beginner


Joined: 29 Aug 2005
Posts: 19
Topics: 7

PostPosted: Thu Mar 26, 2009 8:40 am    Post subject: Lowercase field reporting Reply with quote

I have file which contains a field of 40 characters. Is there a utility in which I can identify if any of the 40 characters contain a lowercase character and report it ?
Back to top
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Thu Mar 26, 2009 9:00 am    Post subject: Reply with quote

application programming is not really the forum to post this question.

i imagine that you could build some sort cards that would accomplish this.

you could also view the file and xclude P'<' in the columns responding to the 40 char field. you could delete the non-xcluded and then create a new file with the remaining lines.

you possibly could use searchfor, but the max output is only 133 char -

you could write a cobol program to perform this function.

if the file is not to big (rlen and record volume) you could write a quick rexx script.

if you have ezytrieve (or something similar - SAS) you could also write a quick and dirty to accomplish this task.
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
computer
Beginner


Joined: 12 Jun 2007
Posts: 64
Topics: 17
Location: Hyderabad

PostPosted: Thu Mar 26, 2009 9:15 am    Post subject: Reply with quote

Hi madisand,

Here is an COBOL program which will serve your purpose.

In cobol we have inbuit function which can retrieve the charater when a ascii code is passed to the function.

Now first retrieve all the ASCII characters for all the lower case letters....
check the link:http://docs.hp.com/cgi-bin/doc3k/B3150090013.11820/122

Thanks,
computer
Now do as shown below,

01 ASCII-a PIC 9(02) VALUE 'ascii value of a'

01 VARIABLE
05 VAR PIC X(40)
05 VAR1 REDEFINES VAR PIC 9 OCCURS 40 TIMES.

MOVE VAR TO VAR1.

Keep this loop for all 4o chanracters
IF FUNCTION CHAR(ASCII-a) = 'a' / VAR1(I)
DISPLAY 'LOWER CASE LETTERS EXISTS'
ELSE
DISPLAY 'LOWER CASE LETTERS DOES NOT EXISTS'
END-IF
Back to top
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Thu Mar 26, 2009 9:31 am    Post subject: Reply with quote

why would anyone want to search for ASCII hex values on an IBM machine?

madisand,

I would INSPECT the 40 char field looking for less than 'A' (capital A) and not = SPACES.
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
jsharon1248
Intermediate


Joined: 08 Aug 2007
Posts: 291
Topics: 2
Location: Chicago

PostPosted: Thu Mar 26, 2009 11:47 am    Post subject: Reply with quote

You posted in the Application Programming section, so if you need a COBOL solution, use a class test.

Code:
ALPHABETIC-LOWER
Identifier consists entirely of any combination of the lowercase alphabetic characters a through z and the space.


Code:
PERFORM VARYING X FROM 1 BY 1 UNTIL X > LENGTH OF STRING-VAR
  IF STRING-VAR(X:1) IS ALPHABETIC-LOWER
    <it's lower case>
  ELSE
    <it's not lower case>
  END-IF
END-PERFORM
Back to top
View user's profile Send private message
slade
Intermediate


Joined: 07 Feb 2003
Posts: 266
Topics: 1
Location: Edison, NJ USA

PostPosted: Fri May 08, 2009 9:38 pm    Post subject: Reply with quote

Not sure what your requirement is, but if you just want to verify that all chars are ALPHABETIC-LOWER you can just code:
Code:
IF STRING-VAR IS NOT ALPHABETIC-LOWER
   PERFORM ERR-RTN
ELSE
   DO-GOOD-STUFF
END-IF

If you can't use the SPACE as jsharon noted, you can create your own CLASS, e.g. MY-ALPHA-LOWER, without the SPACE.

See the SPECIAL-NAMES paragraph section of the COBOL Ref Guide.
_________________
Regards, Jack.

"A problem well stated is a problem half solved" -- Charles F. Kettering
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
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


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group