IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Packed decimal to Alphanumeric


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
kris_madras
Warnings : 1

New User


Joined: 04 Jul 2005
Posts: 31

PostPosted: Wed May 05, 2021 12:21 am
Reply with quote

Hi,
I have input feed in the form pic s9(7)v9(2) comp-3.
I need to move this input to output variable X(9).
Also need to remove leading zeroes in the decimal portion.
Please suggest.

Input -1: 1234.00
Output expected : xxx123400 (x is space)

Input -2: 0.58
Output expected : xxxxxxx58 (x is space)

Input -3: 2345.67
Output expected : xxx234567 (x is space)

Input 4-: 0.00
Output expected : xxxxxxxxx (x is space)

Thanks
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1590
Location: Andromeda Galaxy

PostPosted: Wed May 05, 2021 1:51 am
Reply with quote

Hi

What have you tried please?

Also what do you expect if your input is less than zero?

Can you also double check if 0.00 is input you need output as spaces?
Back to top
View user's profile Send private message
sergeyken
Warnings : 2

Senior Member


Joined: 29 Apr 2008
Posts: 1188

PostPosted: Wed May 05, 2021 9:36 pm
Reply with quote

FYI:

COBOL Programming Guide

COBOL Language Reference
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Numeric check on packed signed and un... COBOL Programming 4
No new posts DECIMAL HOST VARIABLE OR PARAMETER 14... DB2 7
No new posts Negative value - packed field - Natur... Java & MQSeries 0
No new posts HOW TO OVERLAY A Packed decimal VALUE... DFSORT/ICETOOL 5
This topic is locked: you cannot edit posts or make replies. Assembler - Packed Decimals - PACK in... PL/I & Assembler 3
Search our Forums:

Back to Top