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
 
Move from Numeric to Alphanumeric

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

New User


Joined: 22 Sep 2008
Posts: 8
Location: Bangalore

PostPosted: Fri Oct 30, 2009 8:06 pm    Post subject: Move from Numeric to Alphanumeric
Reply with quote

Hi All,
I have a boubt
A PIC X(04) 'ABCD'
B PIC S9(05) '10000'

If i move from B to A -------- > Result ?
if i move from A to B ---------> Result?

Coulf you please tell me...


Thanks,
Vamsi Varanasi
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


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

PostPosted: Fri Oct 30, 2009 8:17 pm    Post subject:
Reply with quote

Basic syntax errors in your post: (1) no level numbers on the variables, (2) B cannot have quotes around the value literal, (3) VALUE is not optional, and (4) periods are recommended.

I ran this code:
Code:
           05  A-FROM                  PIC X(04)  VALUE 'ABCD'.
           05  B-TO                    PIC S9(05) VALUE 10000.
           05  A-TO                    PIC X(04)  VALUE 'ABCD'.
           05  B-FROM                  PIC S9(05) VALUE 10000.

      /
       PROCEDURE DIVISION.
       S1000-MAIN       SECTION.
           MOVE A-FROM                 TO  B-TO.
           MOVE B-FROM                 TO  A-TO.
           DISPLAY 'A FROM: ' A-FROM.
           DISPLAY 'A TO:   ' A-TO.
           DISPLAY 'B FROM: ' B-FROM.
           DISPLAY 'B TO:   ' B-TO.
and got results of
Code:
 A FROM: ABCD
 A TO:   1000
 B FROM: 1000{
 B TO:   0ABCD
Which is precisely what you would expect by reviewing the rules for elementary MOVE statements in the COBOL Language Reference manual (link at the top of the page).
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 2 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 Move from Comp3 variable to Edited Va... sreekusr COBOL Programming 8 Thu Aug 10, 2017 4:20 pm

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