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

Syncsort - COMP-2 to ZD


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Wed Jul 27, 2011 6:24 pm
Reply with quote

Hi,

I want to know how can we convert COMP-2 to ZD (Readable format) in Syncsort?

Suppose the value is 1.19875E3 it should get converted to 1198.75
Back to top
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Wed Jul 27, 2011 6:28 pm
Reply with quote

I have referred to the post - ibmmainframes.com/about46065.html

But I don't want to loose the decimal part.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Wed Jul 27, 2011 6:40 pm
Reply with quote

gylbharat wrote:
I have referred to the post - ibmmainframes.com/about46065.html

But I don't want to loose the decimal part.


How many decimal places do you want to keep?

If 2, multiply the FL by 100 first
If 3, multiply the FL by 1000 first
If 4, multiply the FL by 10000 first
etc
Back to top
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Thu Jul 28, 2011 1:31 pm
Reply with quote

Its not working for me....

My value is
Code:

+5.345000000000000E+01


Can anyone please help me in getting the value as -
Code:

53.450000

using syncsort.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Jul 28, 2011 4:35 pm
Reply with quote

You know the drill. "It's not working" is useless.

You originally asked for it to go to ZD. ZD does not contain ".". You'd need an edit mask to get it to appear with the ".".

It seems you want six decimal places.

Your typical ZD in a sort has no implied decimal places (or, another way, it has any number of implied decimal places, you just have to do the implying seperate to the field).

So, say you have 10 bytes. You want six for the decimal places.

If you transfer the floating to the ZD, you will loose low-order significance unless you specifically code for it, as there is no implicit decimal in the ZD.

So, for six places, multiply by 1000000 first, then transfer to the ZD.

If this does not work, show what it does do, please.
Back to top
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Thu Jul 28, 2011 7:18 pm
Reply with quote

Hi Bill,

I tried using this -
Code:

//STEP050  EXEC PGM=SORT                                       
//SYSOUT   DD SYSOUT=*                                         
//SORTIN   DD DSN=ITA.TEST.AJ.WORK.XMITIN.EWHOLD01,DISP=SHR     
//SORTOUT  DD SYSOUT=*                                         
//SYSIN    DD *                                                 
  SORT FIELDS=COPY                                             
  OUTREC FIELDS=(01:58,8,                                       
                 09:C' ',                                       
                 10:58,8,FL,MUL,+1000000,EDIT=(TTT.TTTTTT))     
/*                                                             

But still not getting the output
Code:

 =COLS> ----+----1----+----
 ****** *******************
 000001 â Ë      053.000000
 000002          000.000000
 000003 â ÌéÔe ½ 017.000000
 000004          000.000000
 000005          000.000000
 000006          000.000000
 000007 â 'øtP   052.000000
 000008          000.000000
 000009 â ¿e ½éÖ 016.000000
 000010          000.000000


In Hex
Code:

=COLS> ----+----1----+----
****** *******************
000001 â Ë      053.000000
       437333334FFF4FFFFFF
       253333330053B000000
--------------------------
000002          000.000000
       000000004FFF4FFFFFF
       000000000000B000000
--------------------------
000003 â ÌéÔe ½ 017.000000
       4175E81B4FFF4FFFFFF
       2181B5E80017B000000
--------------------------
000004          000.000000
       000000004FFF4FFFFFF
       000000000000B000000
--------------------------
000005          000.000000
       000000004FFF4FFFFFF
       000000000000B000000
--------------------------
000006          000.000000
       000000004FFF4FFFFFF
       000000000000B000000
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Jul 28, 2011 7:46 pm
Reply with quote

Mmmm.... I was thinking you wanted it in a ZD first, then could apply the edit the to ZD.

However, the approach you have taken might be hinting that this won't work either. On the other hand, you are getting more than one digit of integer.

Try just converting it to ZD so you know whether that route works. If not, back to the drawing board.

Have you got a SYNCSORT manual?
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Jul 29, 2011 1:03 am
Reply with quote

gylbharat,

After I got a big hint, this is not going to work. Any arithmetic is only going to apply to the integer part of the floating-point number, so the fractional part cannot be made into "integer" by multiplication. Sorry about that.

Fancy a little Cobol to do it?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Fri Jul 29, 2011 1:05 am
Reply with quote

Hello,

Why might this need to be people-readable?

The computers have no trouble at all with the float format and if any real processing is to be done, i expect it is to be with computers.
Back to top
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Fri Jul 29, 2011 11:48 am
Reply with quote

Hi Dick,

There is requirement where we have to FTP this file to a Unix box and there while processing this , the columns should be in a readable format.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Fri Jul 29, 2011 7:38 pm
Reply with quote

Hello,

Last i heard, UNIX works with floating point. . .

Probably there is something i misunderstand.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Jul 29, 2011 8:05 pm
Reply with quote

Hello,

Good old EBCDIC-to-ASCII translation. Good way to garble "non-display" fields, as all sorts of values for "control codes" in your binary fields get translated rather than left asis, let alone if you happen to have values which are "display" in your fields, they'll go mess about with themselves as well.

I know you're aware of this :-)

Also, is the Unix 7-bit? Is the float the same internal format? Best way to go for display, my opinion.
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts COBOL - Move S9(11)v9(7) COMP-3 to -(... COBOL Programming 5
No new posts Converting ASCII values to COMP-3 (ZD... JCL & VSAM 2
No new posts Count Records with a crietaria in a f... DFSORT/ICETOOL 5
No new posts Interviewers are surprised with my an... Mainframe Interview Questions 6
Search our Forums:

Back to Top