Movement of X(19) to COMP-3 (Packed Decimal)

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

Movement of X(19) to COMP-3 (Packed Decimal)

Postby gurvinder23 » Thu Aug 13, 2009 4:53 pm


I have an input file with length x(19) and want to convert the data in the output file as COMP-3 (Packed Decimal).

I tried using FUNCTION NUMVAL but its not working .

Can you please let me know how to do the conversion? Example with Code would be highly appreciated.
Posts: 1
Joined: Thu Aug 13, 2009 3:15 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Movement of X(19) to COMP-3 (Packed Decimal)


Re: Movement of X(19) to COMP-3 (Packed Decimal)

Postby dick scherrer » Fri Aug 14, 2009 2:10 am

Hello and welcome to the forum,

Posting "it is not working" provides nothing for us to use to help you.

You need to post any diagnostic info or explain the undesired results.

In addition to mentioning what the actual problem is, posting your variables and the statement with the NUMVAl will also help us help you. When posting program code, jcl, data, etc., use the "Code" tag to preserve slignment and improve readability. Use Preview to see your post as it will appear to the forum then Submit when the post is as you want it.
Hope this helps,
User avatar
dick scherrer
Global moderator
Posts: 6308
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 90 times

Re: Movement of X(19) to COMP-3 (Packed Decimal)

Postby Anuj Dhawan » Mon Aug 17, 2009 3:25 pm

I agree with Dick, but with the information in hand suggest you look here: Converting to numbers (NUMVAL, NUMVAL-C).
Anuj Dhawan
Posts: 274
Joined: Mon Feb 25, 2008 3:53 am
Location: Mumbai, India
Has thanked: 6 times
Been thanked: 4 times

Return to IBM Cobol


  • Related topics
    Last post