View previous topic :: View next topic
|
Author |
Message |
thilakvs Warnings : 1 New User
Joined: 07 Aug 2007 Posts: 27 Location: chennai
|
|
|
|
I want to convert BI to ZD. This is the input i m having.
1234567890,2222222
-2147483647,222222
-1111111111,22222
2147483647,22222
2020952576,2222
1020952576,2222
i m getting the output like this
102095257F,
123456789{,
202095257F,
214748364G,
214748364I,
318385618E,
i m trying to convert 4 bytes like
OUTREC FIELDS = (1,4,BI,ZD)
But i m not able to get expected output.. |
|
Back to top |
|
|
krisprems
Active Member
Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
Back to top |
|
|
PeD
Active User
Joined: 26 Nov 2005 Posts: 459 Location: Belgium
|
|
|
|
These are data, and not direct link with JCL.
Wrong forum. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
These are data, and not direct link with JCL.
Wrong forum. |
Depends on whether this is DFSORT or Syncsort |
|
Back to top |
|
|
PeD
Active User
Joined: 26 Nov 2005 Posts: 459 Location: Belgium
|
|
|
|
?? even if it is with DFSORT or Syncort it ist still programs ( or utilities ) and there is a dedicated forum for that ?
Soupir ! Snif ! |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hi Pierre,
Yup, there is a "home" for DFSORT.
Syncsort topics tend to gather in JCL.
d |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
I want to convert BI to ZD. This is the input i m having.
1234567890,2222222
-2147483647,222222
-1111111111,22222
2147483647,22222
2020952576,2222
1020952576,2222
|
These are NOT BI values. BI values cannot be displayed directly and cannot be negative. FI values cannot be displayed directly but can be negative. BI and FI values can be displayed as hex or converted to displayable characters.
These look like FS (floating sign) values.
You need to explain more clearly what your input values look like. Do they actually look like you've shown, or are these converted values, or what? Showing the input records in hex would help.
Perhaps it's just a matter of using:
Code: |
OUTREC BUILD=(1,4,FI,TO=ZDF)
|
but that's just a wild guess given that it isn't clear what your input actually looks like. |
|
Back to top |
|
|
thilakvs Warnings : 1 New User
Joined: 07 Aug 2007 Posts: 27 Location: chennai
|
|
|
|
Hi,
Let me clear my question:
I have used File aid to view that Binary value and from there the values are
I/P File
999999999
2147483647
1111111111
2147483647
2020952576
1020952576
And the Expected O/P file is
999999999
1020952576
1111111111
2020952576
2147483647
2147483647
And the o/p that I am getting is
099999999I
102095257F
111111111A
202095257F
214748364G
214748364G
The sort Card that I have used is
SORT FIELDS=(1,4,BI,A)
OUTREC BUILD=(1,4,BI,TO=ZD)
Why is the sort giving unexpected results and is there any way in getting the expected result.
I have used the following sort card to get the expected results but I would like to know why my other sort card is not working
SORT FIELDS=(1,4,BI,A)
OUTREC BUILD=(1:1,4,BI,EDIT=(TTTTTTTTTT))
Thanks for all your help |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
Why is the sort giving unexpected results and is there any way in getting the expected result |
The sort is giving the proper results. You asked for zoned-decimal output (which includes a sign) and that is what the output contains.
The letters A thru I are the positive values for 1 - 9. If you had any negative values, you would see J - R for minus 1 - 9.
Plus and minus zero are shown as { and }. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
thilakvs,
When I run a DFSORT job with your example input and control statements, the output has what you want:
Code: |
0999999999
1020952576
1111111111
2020952576
2147483647
2147483647
|
Note that's because DFSORT uses an F for the positive ZD sign with TO=ZD. So if the last digit is 1, you will get X'F1' = '1'.
Since you are getting a C sign (X'C1' = 'A' instead of X'F1' = '1') that means you're NOT using DFSORT. I suspect you're using Syncsort which uses a C sign for the positive ZD sign with TO=ZD. If you were using DFSORT, you would get the result you expect. With Syncsort, you don't.
DFSORT allows TO=ZDF to specify F as the sign (equivalent to TO=ZD in DFSORT's case) - perhaps Syncsort allows TO=ZDF to change their default. |
|
Back to top |
|
|
thilakvs Warnings : 1 New User
Joined: 07 Aug 2007 Posts: 27 Location: chennai
|
|
|
|
Thanks a lot Dick and Frankā¦. I managed to get the expected results using ZDF |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
You're welcome
Thank you for letting us know it is working.
d |
|
Back to top |
|
|
Simma Hemanth
New User
Joined: 05 Jul 2021 Posts: 7 Location: India
|
|
|
|
Hi,
let me explain my question,
i have a COMP S9(9) length-4 value -803 . now i have convert this comp variable to character ZD.
My Expected output:
is same as above i/p value -803
Code: |
OUTREC FIELDS=(79,4,FI,TO=ZDF)
|
but, i'm getting this as output - 000000080L
kindly let me know, what to do and move further
thanks in advance |
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1329 Location: Bamberg, Germany
|
|
|
|
Do not hijack year old topics! Create a new one if needed. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3076 Location: NYC,USA
|
|
|
|
Locked. Please don't tailgate old topics. |
|
Back to top |
|
|
|