View previous topic :: View next topic
|
Author |
Message |
gylbharat
Active Member
Joined: 31 Jul 2009 Posts: 565 Location: Bangalore
|
|
|
|
Hi,
I tried running with EDIT masks... But every data can be different depending upon power of 10. In such cases how do we specify how many digits there will be after decimal point.
Example.
INPUT FILE:
Code: |
RECFM FB LRECL 80 Rec# 1 - CAPS OFF I+D ON
EMP-ID FILLER EMP-NAME FILLER EMP-FD
C(6) (1-6) C(1) (7-7) C(10) (8-17) C(1) (18-18) FP(4) (19-22)
---------- ---------- ------------ ------------ -------------
****** ************************** TOP OF DATA **************************
000001 111111 AAAAAAA +1.23456E+01
000002 111111 AAAAAAA +1.23456E+02
000003 111111 AAAAAAA +1.23456E+03
000004 111111 AAAAAAA +1.23456E+04
000005 111111 AAAAAAA +1.23456E+05
000006 111111 AAAAAAA +1.23456E+06
000007 111111 AAAAAAA +1.23456E+07
000008 111111 AAAAAAA +1.23456E+08
000009 111111 AAAAAAA +1.23456E+09
000010 111111 AAAAAAA +1.23456E+10
000011 111111 AAAAAAA +1.23456E+11
000012 111111 AAAAAAA +1.23456E-01
000013 111111 AAAAAAA +1.23456E-02
000014 111111 AAAAAAA +1.23456E-03
000015 111111 AAAAAAA +1.23456E-04
000016 111111 AAAAAAA +1.23456E-05
000017 111111 AAAAAAA +1.23456E-06
000018 111111 AAAAAAA +1.23456E-07
000019 111111 AAAAAAA +1.23456E-08
000020 111111 AAAAAAA +1.23456E-09
000021 111111 AAAAAAA +1.23456E-10
000022 111111 AAAAAAA +1.23456E-11
|
SORT JOB
Code: |
//STEP EXEC PGM=SORT
//SORTIN DD DSN=DATASET,DISP=SHR
//SORTOUT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(1,22,C'*',19,4,FL,EDIT=(TTTTTTTTTT.TTTTTTTTTTTTT))
|
SORTOUT OUTPUT
Code: |
****** ***************************** Top of Data ******************************
000001 111111 AAAAAAA Egº*0000000000.0000000000012
000002 111111 AAAAAAA â#ÈA*0000000000.0000000000123
000003 111111 AAAAAAA ä( 8*0000000000.0000000001234
000004 111111 AAAAAAA à º*0000000000.0000000012345
000005 111111 AAAAAAA á *0000000000.0000000123456
000006 111111 AAAAAAA ã Oa*0000000000.0000001234561
000007 111111 AAAAAAA ã¯/ *0000000000.0000012345614
000008 111111 AAAAAAA åͯy*0000000000.0000123456128
000009 111111 AAAAAAA çñnY*0000000000.0001234561024
000010 111111 AAAAAAA ñ Ù£*0000000000.0012345610240
000011 111111 AAAAAAA ¢ ´þ*0000000000.0123456061440
000012 111111 AAAAAAA ªJ*0000000000.0000000000000
000013 111111 AAAAAAA j+*0000000000.0000000000000
000014 111111 AAAAAAA &Y=*0000000000.0000000000000
000015 111111 AAAAAAA aËÚ*0000000000.0000000000000
000016 111111 AAAAAAA õ Ú*0000000000.0000000000000
000017 111111 AAAAAAA ¶Ã*0000000000.0000000000000
000018 111111 AAAAAAA Q*0000000000.0000000000000
000019 111111 AAAAAAA *0000000000.0000000000000
000020 111111 AAAAAAA èOy*0000000000.0000000000000
000021 111111 AAAAAAA g¨û*0000000000.0000000000000
000022 111111 AAAAAAA R D*0000000000.0000000000000
****** **************************** Bottom of Data ****************************
|
|
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Easy. There will always be one digit in front of the decimal place. By convention, this will either be significati (1 through 9) or zero. The rest of (or the entire) the number is represented in the decimal part, and carries a "scaling" factor, like your example. E+09, E-02. Which is X10 to the power of 9, and X10 to the power of minus 2 (the last is a number less than 1 or greater than -1 if the number is negative.
If there is nothing in the MASK which supports this notation, then you can't do it with the MASK.
Which leaves, doing it in a program, or trying to "unpick" the data format. If you want to try the last, you have to find out how COMP-1 is stored (COMP-2 is the same, just longer). |
|
Back to top |
|
|
gylbharat
Active Member
Joined: 31 Jul 2009 Posts: 565 Location: Bangalore
|
|
|
|
Is there a way in sort to convert FL to External floating point as 1.23E+01 |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
This is taking a long time :-)
You have Syncsort documentation. You can check whether there is anything in the edit MASK which supports floating point.
If there is not, you either have to "invent" a method to do it by decomposing the format of the data that the "float" is held in, or your need to do it in something else (as was suggested much earlier in the thread). |
|
Back to top |
|
|
gylbharat
Active Member
Joined: 31 Jul 2009 Posts: 565 Location: Bangalore
|
|
|
|
I do not have syncsort documentation... However, I checked the edit masks given in the below link...
www.ibmmainframes.com/post-40358.html
looks like there is no edit mask for floating point numbers. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
OK, I suspect that it has been suggested to you before to get the documentation. So, do it.
For now that leaves you with understanding how COMP-1 is represented in binary and working out how to take it apart with Syncsort.
or
Doing it in a program.
I get the feeling I've written this more than once in this thread :-) |
|
Back to top |
|
|
gylbharat
Active Member
Joined: 31 Jul 2009 Posts: 565 Location: Bangalore
|
|
|
|
Thanks Bill... I will check out the documentation. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
In case this has not been mentioned previously, the material is available from Syncsort Support for free to organizations that are licensed to use Syncsort.
Over the weekend i did a bit of reading in the current Syncsort documentation. While Floating Point is "supported", i did not see a way to get the output you want.
I'd suggest opening an issue with Syncsort Support and they can explain how to do this - if it is possible. We'd appreciate an update either way
Not to beat up the same thought - but how does the current application show these fields? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
time to lock the topic,
the useless back and forth is just a waste of time for everybody |
|
Back to top |
|
|
|