Logo 
Search:

Cobol Articles

Submit Article
Home » Articles » Cobol » Homework HelpRSS Feeds

Program using sign test whether entered value is alphabetic, numeric and alphanumeric etc

Posted By: Amelia Schmidt     Category: Cobol     Views: 4707

Write a program using sign test whether entered value is alphabetic, numeric and alphanumeric etc.

Code for Program using sign test whether entered value is alphabetic, numeric and alphanumeric etc in Cobol

       IDENTIFICATION DIVISION.
        PROGRAM-ID. CLTEST4.

       DATA DIVISION.
        WORKING-STORAGE SECTION.
          01 TMP. 
           05 STR1 PIC X(6).

       PROCEDURE DIVISION.
        DISP.
           DISPLAY " ENTER VALUE : ".
           ACCEPT STR1.
           IF STR1 IS ALPHABETIC
           DISPLAY STR1 " IS ALPHABETIC  "
      *    ELSE IF STR1 IS ALPHABETIC-UPPER
      *     DISPLAY STR1 " IS ALPHABETIC UPPERCASE "
      *    ELSE IF STR1 IS ALPHABETIC-LOWER
      *     DISPLAY STR1 " IS ALPHABETIC LOWERCASE  "
           ELSE IF STR1 IS NUMERIC
           DISPLAY STR1 " IS NUMERIC "
           ELSE 
           DISPLAY STR1 " IS ALPHANUMERIC " 
           END-IF.
            STOP RUN.
       
/*********************************************************************************************
OUTPUT
**********************************************************************************************/
ENTER VALUE : premkiran02 premkiran02 IS ALPHANUMERIC
  
Share: 



Amelia Schmidt
Amelia Schmidt author of Program using sign test whether entered value is alphabetic, numeric and alphanumeric etc is from Frankfurt, Germany.
 
View All Articles

 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!