Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Comparison b/n Alphanumeric and numeric

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
sriraj1122

New User


Joined: 18 Dec 2008
Posts: 15
Location: Hyderabad

PostPosted: Wed Nov 17, 2010 3:38 pm    Post subject: Comparison b/n Alphanumeric and numeric
Reply with quote

Hi all,

I have the below piece of code

Code:
WORKING-STORAGE SECTION.                         
01 WS-NAME         PIC X(1) VALUE SPACES.         
01 WS-NUM          PIC 9(3) VALUE ZEROS.         
PROCEDURE DIVISION.                               
    MOVE 'Y' TO WS-NAME.                         
    MOVE 'APP' TO WS-NAME1.                       
    MOVE 9   TO WS-NUM.                           
    IF WS-NAME > WS-NUM                           
       DISPLAY WS-NAME                           
    ELSE                                         
        DISPLAY WS-NUM                           
    END-IF.                                       
    STOP RUN.               


For the above program the result is as below
****
009
****

Can someone pls explain how internal comparison will be done b/n alphanumeric and numeric datatypes.
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Wed Nov 17, 2010 3:48 pm    Post subject:
Reply with quote

Quote:
MOVE 'APP' TO WS-NAME1.


you have a choice. explain what this statement has to do with anything
or
RTFM.

this question belongs in the beginners forum.
Back to top
View user's profile Send private message
sriraj1122

New User


Joined: 18 Dec 2008
Posts: 15
Location: Hyderabad

PostPosted: Wed Nov 17, 2010 4:06 pm    Post subject:
Reply with quote

does this website has special forum for beginners ?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8154
Location: East Dubuque, Illinois, USA

PostPosted: Wed Nov 17, 2010 4:48 pm    Post subject:
Reply with quote

http://www.ibmmainframeforum.com is specifically for beginners.
Back to top
View user's profile Send private message
sriraj1122

New User


Joined: 18 Dec 2008
Posts: 15
Location: Hyderabad

PostPosted: Thu Nov 18, 2010 10:02 am    Post subject:
Reply with quote

Thnx a lot Robert!!
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 1 Tue Sep 26, 2017 3:35 am
No new posts Remove leading spaces from numeric field rexx77 SYNCSORT 6 Wed Sep 06, 2017 2:15 am
No new posts Return a Non Numeric value from REXX Learncoholic CLIST & REXX 3 Fri Sep 01, 2017 8:33 pm
No new posts Select numeric portion from CHAR data... balaji81_k DB2 6 Sat Aug 19, 2017 1:51 am
No new posts Validate if a Value from the file is ... balacsv2 COBOL Programming 8 Mon Jun 19, 2017 11:52 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us