Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Converting X(16) data to X(9) data

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

New User


Joined: 10 Sep 2005
Posts: 4

PostPosted: Mon Oct 03, 2005 10:54 pm    Post subject: Converting X(16) data to X(9) data
Reply with quote

Hi,

I have to convert 16-digit number which is in the form of X(16) data into packed X(9) data. Could any body let me know how to go about it.

Thanks in advance,
Back to top
View user's profile Send private message

priya

Moderator


Joined: 24 Jul 2003
Posts: 568
Location: Bangalore

PostPosted: Tue Oct 04, 2005 12:31 pm    Post subject:
Reply with quote

I could't get into your question.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Thu Oct 06, 2005 1:25 am    Post subject:
Reply with quote

I'm guessing you want to somehow store the value of a 16 digit number in 9 bytes of data.

Since is's 9 bytes and not 8, that eliminates conversion to binary (COMP).
That leaves conversion to packed decimal (COMP-3).
Code:

01  16-byte-x-fld    pic   x(016).
01  16-byte-9-fld    redefines
    16-byte-x-fld    pic S9(016).

01  9-byte-pd-fld    pic S9(016) comp-3.


move 16-byte-9-fld to 9-byte-pd-fld
Back to top
View user's profile Send private message
Sridevi_C

Active User


Joined: 22 Sep 2005
Posts: 104
Location: Concord, New Hampshire, USA.

PostPosted: Thu Oct 06, 2005 1:59 am    Post subject:
Reply with quote

Hi Jack,
I think,you missed to specify the usage as COMP-3 for 9-byte-pd-fld in your code.
Regards,
Sridevi.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Fri Oct 07, 2005 4:43 am    Post subject:
Reply with quote

Good catch Sridevi. I made the correction.

Thanx and
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 Storing huge volume of data, compare ... Pradeep K M All Other Mainframe Topics 3 Mon Jan 16, 2017 5:08 pm
No new posts how to recover an uncataloged VSAM da... archanamuthukrishnan All Other Mainframe Topics 3 Wed Jan 11, 2017 6:18 pm
No new posts DB2 query Using Recursion, Converting... smilewithashu2 DB2 1 Tue Jan 03, 2017 12:50 pm
No new posts HALDB data refresh/copy from producti... vineetanand2007 IMS DB/DC 0 Mon Jan 02, 2017 11:16 am
No new posts JES2 JEC: Use UNIX Pipes to Pass Data... Virendra Shambharkar JCL & VSAM 21 Tue Dec 20, 2016 6:55 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us