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
 

 

ICETool : manipulating floating point fields

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Frank Cukerman

New User


Joined: 16 Feb 2015
Posts: 4
Location: France

PostPosted: Tue Feb 17, 2015 9:23 pm    Post subject: ICETool : manipulating floating point fields
Reply with quote

Hello,

I have to sort some files, and one of them looks like this :

Code:

0        1         2         3         4         5         6         7         8         9        0          1         2
 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
 
 2015022 10 QUEUE1                                     00000004 00000838 00000530 00000308   2.1E+03   9.3E+02  1.5E+03
 2015022 10 QUEUE2                                     00000003 00000200 00000100 00000100   1.3E+05   1.2E+05  1.3E+05
 2015022 10 QUEUE3                                     00000004 00000980 00000490 00000490   1.2E+05   8.1E+03  6.5E+04
 2015022 10 QUEUE4                                     00000003 00000085 00000085 00000085   1.8E+03   1.8E+03  1.8E+03
 2015022 10 QUEUE5                                     00000035 00023018 00000677 00000677   2.7E+06   1.8E+06  2.0E+06
 2015022 10 QUEUE6                                     00000001 00000200 00000200 00000200   8.2E+06   8.2E+06  8.2E+06
 2015022 10 QUEUE7                                     00000038 00017210 00001019 00000721   4.5E+04   8.5E+02  4.5E+03
 2015022 10 QUEUE8                                     00000072 00031833 00000973 00000439   2.8E+04   7.5E+02  3.3E+03
 2015022 10 QUEUE4                                     00000004 00000170 00000085 00000085   2.3E+03   2.2E+03  2.2E+03
 2015022 10 QUEUE2                                     00000003 00000200 00000100 00000100   1.2E+05   1.2E+05  1.2E+05
 2015022 10 QUEUE2                                     00000003 00000200 00000100 00000100   1.3E+05   1.3E+05  1.3E+05
 2015022 10 QUEUE2                                     00000001 00000000 00000000 00000000   1.3E+05   1.3E+05  1.3E+05
 2015022 10 QUEUE9                                     00000001 00000000 00000000 00000000   1.3E+05   1.3E+05  1.3E+05
 2015022 10 QUEUE2                                     00000002 00000100 00000100 00000100   1.1E+05   1.1E+05  1.1E+05
 2015022 10 QUEUE5                                     00000016 00010115 00000677 00000669   2.3E+05   7.5E+04  1.6E+05
 2015022 10 QUEUE10                                    00000002 00000677 00000677 00000677   1.4E+06   1.4E+06  1.4E+06
 2015022 10 QUEUE11                                    00000001 00001114 00001114 00001114   1.1E+05   1.1E+05  1.1E+05
 2015022 10 QUEUE4                                     00000006 00000170 00000085 00000085   1.3E+04   2.0E+03  7.4E+03
 2015022 10 QUEUE11                                    00000001 00000457 00000457 00000457   4.4E+05   4.4E+05  4.4E+05
 2015022 10 QUEUE12                                    00000002 00000651 00000651 00000651   5.0E+04   5.0E+04  5.0E+04
 2015022 10 QUEUE13                                    00000004 00002327 00001000 00000458   2.3E+06   1.1E+05  1.0E+06

Just an explanation for the fields :
Field1 is the date
Field2 is the interval time
Field3 is the MQ Queue name
Field4 is the number of messages read from the queue within an operation
Field5 is the total size in bytes of all messages read in this operation
Field6 is the size of the biggest message read in this operation
Field7 is the size of the smallest message read
Field8 is the maximum time in microseconds when a message was in the queue
Field9 is the minimum time in microseconds when a message was in the queue
Field10 is the average time in microseconds when a message was in the queue

I will have to sort the file (Key to sort : Date + interval time + Queue name)
and to agregate results by queue within the interval, so I need to have the average of field10 the smallest field9 and biggest field 8 for each queue.

I guess to do that I need to convert the floating point fields in decimal, but I don't understand how to do it.
I read the document written by M. Frank Yaeger, but the sample, as far as I understood, is for a display, and I want to do some calculation.

So can someone show me a sample, how to convert through ICETOOL a floating point field to decimal ?

Many thanks for that
Regards,
Frank
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Tue Feb 17, 2015 10:17 pm    Post subject: Reply to: ICEToll : manupulating floating point fields
Reply with quote

Those aren't floating-point numbers. They are characters showing a human-readable representation of a number in "scientific" notation.

You could use UFF on the first three characters of each column, then multiply by the last two. Because these are times, the values will all be positive, as because they can only be whole numbers the exponent will always be positive, so don't worry about either of those.
Back to top
View user's profile Send private message
Frank Cukerman

New User


Joined: 16 Feb 2015
Posts: 4
Location: France

PostPosted: Wed Feb 18, 2015 12:05 pm    Post subject:
Reply with quote

Hello Bill,

thank you for your answer.
I thought about that during the night.
I made some tests, but it's not so simple as you explain, I think.

I'm not sure to understand or interpret what you say with
Quote:
You could use UFF on the first three characters of each column, then multiply by the last two

In this situation (please don't see any offense), it's not multiply the first three characters by the last two, but multiply the first three by 10 exponent last two characters.
And that's what I don't succeed to do
if someone has a suggestion to transform
1.5E+03 in 1500 that would be very nice.
The result should be used in the future for other calculation.

Thanks again, and regards,
Frank
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Wed Feb 18, 2015 1:05 pm    Post subject: Reply to: ICEToll : manupulating floating point fields
Reply with quote

just a POC...
not difficult, but pretty boring to type

the snippet
Code:

 ****** ***************************** Top of Data ******************************
 000001 //ENRICO1 JOB NOTIFY=&SYSUID,
 000002 //             MSGLEVEL=(1,1),CLASS=A,MSGCLASS=X
 000003 //*
 000004 //S1      EXEC PGM=SORT
 000005 //SYSPRINT  DD SYSOUT=*
 000006 //SYSOUT    DD SYSOUT=*
 000007 //SORTIN    DD *
 000008 2.1E+03
 000009 1.3E+05
 000010 //SORTOUT   DD SYSOUT=*
 000011 //SYSIN     DD *
 000012   OPTION COPY
 000013   INREC  IFTHEN=(WHEN=(06,02,CH,EQ,C'03'),
 000014                  OVERLAY=(11:01,03,UFF,M11,LENGTH=8,
 000015                           21:11,08,ZD,MUL,+100)),
 000016          IFTHEN=(WHEN=(06,02,CH,EQ,C'04'),
 000017                  OVERLAY=(11:01,03,UFF,M11,LENGTH=8,
 000018                           21:11,08,ZD,MUL,+1000)),
 000019          IFTHEN=(WHEN=(06,02,CH,EQ,C'05'),
 000020                  OVERLAY=(11:01,03,UFF,M11,LENGTH=8,
 000021                           21:11,08,ZD,MUL,+10000))
 000022    OUTREC BUILD=(1,60,80:X)
 ****** **************************** Bottom of Data ****************************


the result
Code:

********************************* TOP OF DATA **********************************
2.1E+03        021             2100
1.3E+05        013           130000
******************************** BOTTOM OF DATA ********************************
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Wed Feb 18, 2015 1:29 pm    Post subject: Reply to: ICEToll : manupulating floating point fields
Reply with quote

and here is a more complex example dealing with multiple values on the same line
- still pretty boring to type icon_wink.gif

Code:

 ****** ***************************** Top of Data ******************************
 000001 //ENRICO1 JOB NOTIFY=&SYSUID,
 000002 //             MSGLEVEL=(1,1),CLASS=A,MSGCLASS=X
 000003 //*
 000004 //S1      EXEC PGM=SORT
 000005 //SYSPRINT  DD SYSOUT=*
 000006 //SYSOUT    DD SYSOUT=*
 000007 //SORTIN    DD *
 000008 2.1E+03   9.3E+02   1.5E+03
 000009 1.3E+05   1.2E+05   1.3E+05
 000010 //SORTOUT   DD SYSOUT=*
 000011 //SYSIN     DD *
 000012   OPTION COPY
 000013   INREC  IFTHEN=(WHEN=(06,02,CH,EQ,C'02'),
 000014                  OVERLAY=(31:01,03,UFF,M11,LENGTH=10,
 000015                  41:31,10,ZD,MUL,+10,EDIT=(IIIIIIIIII)),HIT=NEXT),
 000016          IFTHEN=(WHEN=(06,02,CH,EQ,C'03'),
 000017                  OVERLAY=(31:01,03,UFF,M11,LENGTH=10,
 000018                  41:31,10,ZD,MUL,+100,EDIT=(IIIIIIIIII)),HIT=NEXT),
 000019          IFTHEN=(WHEN=(06,02,CH,EQ,C'04'),
 000020                  OVERLAY=(31:01,03,UFF,M11,LENGTH=10,
 000021                  41:31,10,ZD,MUL,+1000,EDIT=(IIIIIIIIII)),HIT=NEXT),
 000022          IFTHEN=(WHEN=(06,02,CH,EQ,C'05'),
 000023                  OVERLAY=(31:01,03,UFF,M11,LENGTH=10,
 000024                  41:31,10,ZD,MUL,+10000,EDIT=(IIIIIIIIII)),HIT=NEXT),
 000025          IFTHEN=(WHEN=(16,02,CH,EQ,C'02'),
 000026                  OVERLAY=(51:11,03,UFF,M11,LENGTH=10,
 000027                  61:51,10,ZD,MUL,+10,EDIT=(IIIIIIIIII)),HIT=NEXT),
 000028          IFTHEN=(WHEN=(16,02,CH,EQ,C'03'),
 000029                  OVERLAY=(51:11,03,UFF,M11,LENGTH=10,
 000030                  61:51,10,ZD,MUL,+100,EDIT=(IIIIIIIIII)),HIT=NEXT),
 000031          IFTHEN=(WHEN=(16,02,CH,EQ,C'04'),
 000032                  OVERLAY=(51:11,03,UFF,M11,LENGTH=10,
 000033                  61:51,10,ZD,MUL,+1000,EDIT=(IIIIIIIIII)),HIT=NEXT),
 000034          IFTHEN=(WHEN=(16,02,CH,EQ,C'05'),
 000035                  OVERLAY=(51:11,03,UFF,M11,LENGTH=10,
 000036                  61:51,10,ZD,MUL,+10000,EDIT=(IIIIIIIIII)))
 000037    OUTREC BUILD=(1,70,80:X)
 ****** **************************** Bottom of Data ****************************



Code:

********************************* TOP OF DATA **********************************
2.1E+03   9.3E+02   1.5E+03          021      2100       093       930
1.3E+05   1.2E+05   1.3E+05          013    130000       012    120000
******************************** BOTTOM OF DATA ********************************


up to You to type all the possible exponents and add the process for the third value
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Wed Feb 18, 2015 2:16 pm    Post subject: Reply to: ICEToll : manupulating floating point fields
Reply with quote

Yes, I was a little hasty and implicit.

To simplify enrico's, you could look to use CHANGE= to convert the 01s to 10, 02s to 100, 03s to 1000, 04s to... etc. Determine the largest possible value, and put an appropriate number of leading zeros on the front of each changed value. Then calculate as previously stated.
Back to top
View user's profile Send private message
Frank Cukerman

New User


Joined: 16 Feb 2015
Posts: 4
Location: France

PostPosted: Thu Feb 19, 2015 2:19 pm    Post subject:
Reply with quote

Thank you Enrico and Bill.

For now, I used Enrico's solution as it is (for me) the simpliest to code,and my job was a little bit urgent.
It is working perfectly.

But I will try now to implement Bill's one, just to understand how to do it, as I didn't succeed yesterday.

Thanks a lot to both of you.

Regards,
Frank
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Thu Feb 19, 2015 3:41 pm    Post subject: Reply to: ICETool : manipulating floating point fields
Reply with quote

a REXX snippet along the lines of

Code:

do    pos = 1 to 21 by 10
   do   exp = 1 to 10
      say inrec"IFTHEN=(WHEN=("pos+5",2,ZD,EQ,"exp"),"
      inrec = "      "
      say inrec"       OVERLAY("pos+30":"pos",03,UFF,M11,LENGTH=10,"
      say inrec"       "pos+40":"pos+30",10,ZD,MUL,+"10**(exp-1)",EDIT=(IIIIIIIIII)),HIT=NEXT),"
   end
end


might save a bit of typing
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Thu Feb 19, 2015 3:56 pm    Post subject: Reply to: ICETool : manipulating floating point fields
Reply with quote

An example of using CHANGE= with enrico's data. The NOMATCHs specify default values for when there is no match. If you leave them out, you'll get a run-time failure, which may be safer than just letting it rip.

Code:
  OPTION COPY                           
  INREC OVERLAY=(30:6,2,CHANGE=(10,
                            C'01',C'0000000010',
                            C'02',C'0000000100',
                            C'03',C'0000001000',
                            C'04',C'0000010000',
                            C'05',C'0000100000',
                            C'06',C'0001000000',
                            C'07',C'0010000000',
                            C'08',C'0100000000',
                            C'09',C'1000000000'),
                            NOMATCH=(C'0000000000'),
               41:16,2,CHANGE=(10,
                            C'01',C'0000000010',
                            C'02',C'0000000100',
                            C'03',C'0000001000',
                            C'04',C'0000010000',
                            C'05',C'0000100000',
                            C'06',C'0001000000',
                            C'07',C'0010000000',
                            C'08',C'0100000000',
                            C'09',C'1000000000'),
                            NOMATCH=(C'0000000000'),
               52:26,2,CHANGE=(10,
                            C'01',C'0000000010',
                            C'02',C'0000000100',
                            C'03',C'0000001000',
                            C'04',C'0000010000',
                            C'05',C'0000100000',
                            C'06',C'0001000000',
                            C'07',C'0010000000',
                            C'08',C'0100000000',
                            C'09',C'1000000000'),
                            NOMATCH=(C'0000000000'))
//SORTIN   DD *
2.1E+03   9.3E+02   1.5E+03
1.3E+05   1.2E+05   1.3E+05


Output is:

Code:
2.1E+03   9.3E+02   1.5E+03  0000001000 0000000100 0000001000
1.3E+05   1.2E+05   1.3E+05  0000100000 0000100000 0000100000
Back to top
View user's profile Send private message
Frank Cukerman

New User


Joined: 16 Feb 2015
Posts: 4
Location: France

PostPosted: Thu Feb 19, 2015 7:27 pm    Post subject:
Reply with quote

Thank you Enrico, all the INREC has been coded, copy / paste...

And thank you Bill, because I have to admit I would never have coded the INREC like that.

I keep both solutions in my directory.

Thanks again.
Regards,
Frank
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Access SQLCA fields inside a stored p... gangapd DB2 4 Thu Oct 27, 2016 10:20 am
No new posts How to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm
No new posts ICETOOL/SYNCSORT - SYSPRINT output nartcr DFSORT/ICETOOL 17 Wed Oct 05, 2016 10:46 pm
No new posts Icetool or Joinkeys example to compar... ishant chauhan DFSORT/ICETOOL 21 Sat Aug 20, 2016 2:40 am
No new posts Online Assembler Program Starting point Aditya.Srivastava PL/I & Assembler 4 Fri Jul 08, 2016 6:48 pm


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