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
 
How to get same value from numeric field passed from alphanu

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

Active User


Joined: 02 May 2005
Posts: 128
Location: UK

PostPosted: Thu Jul 19, 2007 3:29 pm    Post subject: How to get same value from numeric field passed from alphanu
Reply with quote

Hello ,

I want to pass value of maximum 5 bytes to alphanumric field and map it to Numeric field 9(5) . And the output of the Numeric field passed to Alphanumric field of x(5).

INitial value should not be changed .Given is the example.

02 WS-XYZ PIC X(5).
02 WS-ABC PIC 9(5).

MOVE ' 0CDE' TO WS-XYZ.
MOVE WS-XYZ TO WS-ABC.
MOVE WS-ABC TO WS-XYZ.

AND THE VALUE OF WS-XYZ COMING AS 0CD5. Is there any way we can get the same output without introducing new variable.
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Jul 19, 2007 7:30 pm    Post subject:
Reply with quote

Hello,

Why would you want to put non-numeric values in a numeric field?

If we understand what the requirement really is, we may be able to offer suggestions.

Even if you find a way to force incompatible values into a field, you will have many problems using that mis-match later. . .
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Thu Jul 19, 2007 8:06 pm    Post subject:
Reply with quote

Because of the lack of the sign on the numeric field, COBOL is forcing the sign for the last digit to "F" - E is x'c5' and 5 is x'f5'.....
You might change the numeric field to s9(5) and see what happens.....
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Jul 19, 2007 8:16 pm    Post subject:
Reply with quote

Hello,

If you make the change to s9(5) and get what you want, please try
Code:
MOVE ' 0CDX' TO WS-XYZ
and post back the result.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Fri Jul 20, 2007 12:07 am    Post subject: Re: How to get same value from numeric field passed from alp
Reply with quote

Hi,

I don't know why you want to do this, but try substituting:

MOVE WS-XYZ TO WS-ABC(1:)

for your 2nd move.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Fri Jul 20, 2007 12:17 am    Post subject:
Reply with quote

Deleted
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 sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts Partial color change of a field in CI... waseem0424 CICS 5 Fri Sep 29, 2017 7:56 pm
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

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