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
 
UNPACKing the COBOL packed numeric data.

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

New User


Joined: 26 Mar 2005
Posts: 17

PostPosted: Thu Jan 19, 2006 7:36 am    Post subject: UNPACKing the COBOL packed numeric data.
Reply with quote

Hello,

Assume some input record contains all packed numeric data. I would like to unpack the digits for reporting purpose. I know ASSEMBLER has unpack instruction. Is there some way one can do this in Enterprise COBOL...?

Thanks for help.
Back to top
View user's profile Send private message

priya

Moderator


Joined: 24 Jul 2003
Posts: 568
Location: Bangalore

PostPosted: Thu Jan 19, 2006 10:14 pm    Post subject:
Reply with quote

Simply move COMP-3 to DISPLAY item before creating the report. it will work.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Fri Jan 20, 2006 7:57 am    Post subject:
Reply with quote

If you're going to print the field it makes more sense to move it to the ediited field in the report line. The edited field could look something like

PIC ----9.99

If you moved a negative 123.45 to it, it would print as -123.45. If you moved a positive 6.54 to it, it would print as bbb6.54, where the "b"s are spaces.
Back to top
View user's profile Send private message
mail_ssb

New User


Joined: 26 Mar 2005
Posts: 17

PostPosted: Sat Jan 21, 2006 2:31 pm    Post subject: UNPACKing the COBOL packed numeric data.
Reply with quote

Hi Priya,

I am sorry, I did not get that. Did you mean that I need to move packed numbers directly into a variable of type 9.

E.g. Say, input is 2 byte comp-3. Should I move this into 9(4) variable of a report layout...? I dont think, that works.

Let me know, if I understood it wrong. Thanks for your help.
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 Extract record for change in combinat... Trinadh DFSORT/ICETOOL 6 Thu Nov 23, 2017 3:32 pm
No new posts Fetching data from JHS as per the cur... arunsoods All Other Mainframe Topics 4 Wed Nov 22, 2017 1:54 pm
This topic is locked: you cannot edit posts or make replies. Cobol to fetch the content by using s... arunc55 COBOL Programming 4 Fri Nov 17, 2017 1:25 pm
No new posts Extract Record using range of Data scorp_rahul23 DFSORT/ICETOOL 3 Wed Nov 15, 2017 11:54 pm
No new posts VBS and VB, COBOL syntax is the same ... natt.sut COBOL Programming 3 Sun Nov 12, 2017 6:36 am

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