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
 

 

Syncsort - COMP-2 to ZD

 
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: Wed Jul 27, 2011 6:24 pm    Post subject: Syncsort - COMP-2 to ZD
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    Post subject:
Reply with quote

I have referred to the post - http://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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

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

gylbharat wrote:
I have referred to the post - http://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    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Thu Jul 28, 2011 4:35 pm    Post subject: Reply to: COMP-2 to ZD
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    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Thu Jul 28, 2011 7:46 pm    Post subject: Reply to: COMP-2 to ZD
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Fri Jul 29, 2011 1:03 am    Post subject: Reply to: Syncsort - COMP-2 to ZD
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

Site Director


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

PostPosted: Fri Jul 29, 2011 1:05 am    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Fri Jul 29, 2011 7:38 pm    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Fri Jul 29, 2011 8:05 pm    Post subject: Reply to: Syncsort - COMP-2 to ZD
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
No new posts Syncsort - Hard coded Value in output PORYES SYNCSORT 1 Thu Nov 03, 2016 9:23 am
No new posts Protection Exception while move 0 to ... Kevin Vaz CICS 10 Tue Oct 18, 2016 4:19 pm
No new posts Syncsort - NULL in Integer field chec... nartcr SYNCSORT 4 Thu Oct 06, 2016 6:47 am
No new posts ICETOOL/SYNCSORT - SYSPRINT output nartcr DFSORT/ICETOOL 17 Wed Oct 05, 2016 10:46 pm


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