Convert Signed integer into alphanumeric



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

Convert Signed integer into alphanumeric

Postby tavisha » Sat Nov 15, 2008 5:51 am

Hi

I need to convert a PIC S9(16)V9(2) COMP-3 variable into Alphanumeric one.
Please suggest how to go about it.

Thanks
Tavisha
tavisha
 
Posts: 11
Joined: Sun Nov 02, 2008 6:22 am
Has thanked: 0 time
Been thanked: 0 time

Re: Convert Signed integer into alphanumeric

 

Re: Convert Signed integer into alphanumeric

Postby dick scherrer » Sat Nov 15, 2008 9:11 am

Hello,

If you explain what you want as output, we will be able to help.

"Alphanumeric" is everything.

Show a few "input" values and how you want the alphanumeric value to be stored for those values.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: Convert Signed integer into alphanumeric

Postby tavisha » Sat Nov 15, 2008 11:17 am

I want PIC S9(16)V9(2) COMP-3 variable to be moved to a variable with PIC(X).
I want to know how can they be converted since I am getting SOC4 when I am trying to move it .

I also tried moving PIC S9(16)V9(2) COMP-3 to PIC 9(16)V9(2) and then to PIC(X) but it didn't work that way as well.
tavisha
 
Posts: 11
Joined: Sun Nov 02, 2008 6:22 am
Has thanked: 0 time
Been thanked: 0 time

Re: Convert Signed integer into alphanumeric

Postby dick scherrer » Sat Nov 15, 2008 11:02 pm

Hello,

To repeat:
Show a few "input" values and how you want the alphanumeric value to be stored for those values.

You have not done this. . .

I also tried moving PIC S9(16)V9(2) COMP-3 to PIC 9(16)V9(2)
This will work on every IBM mainframe. If it dd not work for you, it is because of invalid data.

then to PIC(X) but it didn't work that way
Comp-3 should not be moved to pic x fields.

To expand on my original request for data - show a few the comp-3 "input" values in hex. Also show how you want these stored after the move.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: Convert Signed integer into alphanumeric

Postby raj_mfd » Thu Sep 13, 2012 12:07 am

u can move any value to x(somthing), but u should move a valid value 9(somevalue)for always numeric or s9(some value)v9(some value) comp-3 for always computational values or else u need to intialiaze the value if it a wrong.

Please let me know if i'm wrong..
raj_mfd
 
Posts: 2
Joined: Thu Sep 13, 2012 12:00 am
Has thanked: 0 time
Been thanked: 0 time

Re: Convert Signed integer into alphanumeric

Postby raj_mfd » Thu Sep 13, 2012 12:10 am

but u should maintain the length, if not it will truncate the value...
raj_mfd
 
Posts: 2
Joined: Thu Sep 13, 2012 12:00 am
Has thanked: 0 time
Been thanked: 0 time

Re: Convert Signed integer into alphanumeric

Postby BillyBoyo » Thu Sep 13, 2012 12:14 am

Can you give a few examples illustrating what you are trying to say, please?

What do you feel you may need to INITIALIZE?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: Convert Signed integer into alphanumeric

Postby NicC » Thu Sep 13, 2012 2:56 am

nothing like resurrecting the dead!
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2690
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times

Re: Convert Signed integer into alphanumeric

Postby dick scherrer » Thu Sep 13, 2012 11:22 pm

"Out to the graveyard" - Addams Family
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post