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
 

 

Convert COMP-1 to Readable
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Tue Aug 14, 2012 5:33 pm    Post subject: Convert COMP-1 to Readable
Reply with quote

Hi,

Is there a way to convert COMP-1 data type to readable format?

Like COMP-1 --> 1.2222E01
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Tue Aug 14, 2012 5:35 pm    Post subject: Reply to: Convert COMP-1 to Readable
Reply with quote

yes
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1712
Location: UK

PostPosted: Tue Aug 14, 2012 5:36 pm    Post subject:
Reply with quote

I presume you mean with SYNCSORT as JCL cannot do it and SYNCSORT questions come under this part of the forum.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Tue Aug 14, 2012 5:44 pm    Post subject: Re: Convert COMP-1 to Readable
Reply with quote

gylbharat wrote:
Is there a way to convert COMP-1 data type to readable format?

Like COMP-1 --> 1.2222E01
Do you want to use COBOL or some sort product at your shop. File-Aid can also do it, however, can't really give a direct syntax - as this shop does not have File-Aid installed but it might worth a shot, if you've it and you intend to use it.

Or REXX: http://ibmmainframes.com/about53643.html
Back to top
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Tue Aug 14, 2012 5:47 pm    Post subject:
Reply with quote

I want to do it through Syncsort.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Tue Aug 14, 2012 5:50 pm    Post subject: Reply to: Convert COMP-1 to Readable
Reply with quote

thanks &deity, couldn' t You have said so from the beginning icon_cool.gif
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Tue Aug 14, 2012 6:18 pm    Post subject: Reply to: Convert COMP-1 to Readable
Reply with quote

FWIW, this can be done easily in Assembler, COBOL and PL/I.

In fact, the same code can be used for COMP (Halfword/Fullword) and COMP-2 (Long Float).

Review the following - it's the same concept for all of the above data-formats, including COMP-1 -

http://www.ibmmainframes.com/viewtopic.php?p=172218&highlight=#172218
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Tue Aug 14, 2012 6:34 pm    Post subject:
Reply with quote

gylbharat- I wonder, you dont' remember this one: http://ibmmainframes.com/about55471.html
Back to top
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Thu Aug 16, 2012 12:10 pm    Post subject:
Reply with quote

Hi,

I know, i raised this request some time back... but now its not FTP... we are doing a migration from VSAM files to DB2... we want to get the data in the readable format and then load data in DB2 through load utilities...

We want data to be in readable as it would also help in reconciliation.

Please let me know how we can convert COMP-1 and COMP-2 to readable format through SORT.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Aug 16, 2012 1:11 pm    Post subject:
Reply with quote

db2 has floating point (real and double - which is your comp-1 and comp-2 cobol types).

are you going to have db2 real and double or decimal datatypes?

my own question, but how are you going to reconcile?

maybe using the edit masks to convert floating point to 'readable'.
FL Floating point. Normalized. Signed.
Back to top
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Thu Aug 16, 2012 1:37 pm    Post subject:
Reply with quote

Most probably we would be loading these values in Decimal data types..

Dick, Can you give me a sample to convert FL using EDIT MASKS to readable format?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Aug 16, 2012 1:53 pm    Post subject:
Reply with quote

sorry, i am not a syncsort user, i only have a manual.
Back to top
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Thu Aug 16, 2012 3:43 pm    Post subject:
Reply with quote

Thanks Dick.... I will refer the manual... but a small sample would be helpful... may be someone who is syncsort expert can provide a sample icon_smile.gif
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Aug 16, 2012 7:19 pm    Post subject:
Reply with quote

Hello,

Syncsort MFX (1.4) supports Floating Point.
Back to top
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Thu Aug 23, 2012 4:01 pm    Post subject: Reply to: Convert COMP-1 to Readable
Reply with quote

Any idea any one.... how do we convert comp-1 or comp-2 to readable format using sort?
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Aug 23, 2012 7:16 pm    Post subject:
Reply with quote

Hello,

If i understand, currently the floating point data is processed by the application. DB2 supports floating point (and the table(s) would surely store the data as floating point).

Why is there a need to create something "readable" in the middle? How does the application currently present these values so people can read them?
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Thu Aug 23, 2012 8:22 pm    Post subject: Reply to: Convert COMP-1 to Readable
Reply with quote

You're the one with Syncsort. Did you try with an edit mask? I agree with Dick and dbz, why bother making it "readable" (to humans with no knowledge of internal data representations). It sounds like DB2'll su** it up just fine as it is.
Back to top
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Fri Aug 24, 2012 5:17 pm    Post subject:
Reply with quote

Hi,

Currently the floating point data is present in the VSAM file...

We will be writing a SORT to convert the VSAM file data to flat file with all readable data. That is expanding comp, comp-3, etc... Only problem is with the COMP-1 and COMP-2 fields where we are not able to convert it into readable format using sort.

Once we have the data in the readable format , we will FTP this data to Unix server, where it will be loaded in oracle table.

Having data in the readable format makes it easier in analysis and verify data.

Please let me know how we can convert the COMP-1 data to readable format?
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Fri Aug 24, 2012 6:08 pm    Post subject: Reply to: Convert COMP-1 to Readable
Reply with quote

OK, that is a very good reason to have it in character/text.

Have you tried the edit mask? Seems I've asked that before.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Aug 24, 2012 7:15 pm    Post subject:
Reply with quote

Hello,

How does the current application present these fields to the user?

You may neeed to do the same thing here to get what you want. Possibly by coding a SORT Exit.
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 -> JCL & VSAM All times are GMT + 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts Convert +9999999999999.99 to S9(12)V9(3) vnktrrd DFSORT/ICETOOL 8 Thu Nov 17, 2016 8:15 pm
This topic is locked: you cannot edit posts or make replies. Db2 SQL query to convert rows into co... subratarec DB2 5 Thu Nov 17, 2016 4:51 pm
No new posts convert PD to ZD ram_vizag DFSORT/ICETOOL 5 Sat Nov 05, 2016 3:06 am
No new posts Protection Exception while move 0 to ... Kevin Vaz CICS 10 Tue Oct 18, 2016 4:19 pm


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