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

convert BI to ZD


IBM Mainframe Forums -> JCL & VSAM
Post new topic   This topic is locked: you cannot edit posts or make replies.
View previous topic :: View next topic  
Author Message
thilakvs
Warnings : 1

New User


Joined: 07 Aug 2007
Posts: 27
Location: chennai

PostPosted: Thu Dec 13, 2007 4:11 pm
Reply with 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

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
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Thu Dec 13, 2007 4:18 pm
Reply with quote

Quote:
But i m not able to get expected output..
what is the expected o/p?
Did you look at Converting Numeric Fields to Different Formats
Back to top
View user's profile Send private message
PeD

Active User


Joined: 26 Nov 2005
Posts: 459
Location: Belgium

PostPosted: Thu Dec 13, 2007 4:19 pm
Reply with quote

These are data, and not direct link with JCL.
Wrong forum.
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: Thu Dec 13, 2007 11:04 pm
Reply with quote

Hello,

Quote:
These are data, and not direct link with JCL.
Wrong forum.
Depends on whether this is DFSORT or Syncsort icon_smile.gif
Back to top
View user's profile Send private message
PeD

Active User


Joined: 26 Nov 2005
Posts: 459
Location: Belgium

PostPosted: Thu Dec 13, 2007 11:08 pm
Reply with quote

?? even if it is with DFSORT or Syncort it ist still programs ( or utilities ) and there is a dedicated forum for that ?

Soupir ! Snif ! icon_smile.gif
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: Thu Dec 13, 2007 11:28 pm
Reply with quote

Hi Pierre,

Yup, there is a "home" for DFSORT.

Syncsort topics tend to gather in JCL.

d
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Dec 13, 2007 11:52 pm
Reply with quote

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
View user's profile Send private message
thilakvs
Warnings : 1

New User


Joined: 07 Aug 2007
Posts: 27
Location: chennai

PostPosted: Fri Dec 14, 2007 12:31 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Fri Dec 14, 2007 9:20 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Fri Dec 14, 2007 10:54 pm
Reply with quote

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
View user's profile Send private message
thilakvs
Warnings : 1

New User


Joined: 07 Aug 2007
Posts: 27
Location: chennai

PostPosted: Mon Dec 17, 2007 4:12 pm
Reply with quote

Thanks a lot Dick and Frankā€¦. I managed to get the expected results using ZDF icon_lol.gif
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: Mon Dec 17, 2007 9:23 pm
Reply with quote

You're welcome icon_smile.gif

Thank you for letting us know it is working.

d
Back to top
View user's profile Send private message
Simma Hemanth

New User


Joined: 05 Jul 2021
Posts: 7
Location: India

PostPosted: Thu Jul 15, 2021 5:58 pm
Reply with quote

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
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1255
Location: Bamberg, Germany

PostPosted: Thu Jul 15, 2021 6:10 pm
Reply with quote

Do not hijack year old topics! Create a new one if needed.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3053
Location: NYC,USA

PostPosted: Thu Jul 15, 2021 9:09 pm
Reply with quote

Locked. Please don't tailgate old topics.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies. View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts Keep leading zero(s) after convert fl... SYNCSORT 7
No new posts Convert single row multi cols to sing... DFSORT/ICETOOL 6
No new posts convert file from VB to FB and use tr... DFSORT/ICETOOL 8
No new posts Convert HEX to Numeric DB2 3
Search our Forums:

Back to Top