MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Conversion: Decimal ZD to CHAR

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
ssanthosh
Beginner


Joined: 19 Mar 2007
Posts: 13
Topics: 5

PostPosted: Mon May 11, 2009 9:49 am    Post subject: Conversion: Decimal ZD to CHAR Reply with quote

I have a dataset with LRECEL=100 where the Amount field is defined as S9(13)V9(02). When we ftp this file to windows server, the data is not in readable format. My aim is to convert the Amount field S9(13)V9(02) [= 15 bytes] to character format SX(13).X(2) [= 17 bytes] and then ftp to the server. Is there anyway to we can do this using SORT. I tried the following using SORT
OUTREC OVERLAY=(1,85,86:86,15,ZD,EDIT=(STTTTTTTTTTT.TT),SIGNS=(+,-))
The problem here is that 2 MSB of amount field are getting truncated. After conversion the amount field should be 17 bytes (including Sign and .). The output dataset LRECL wil be 102 bytes. Please help.
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Mon May 11, 2009 10:11 am    Post subject: Reply with quote

You say you want SX(13).X(2), but you are using

EDIT=(STTTTTTTTTTT.TT)

which seems to be equivalent to SX(11).X(2). I would think you'd want

EDIT=(STTTTTTTTTTTTT.TT)
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ssanthosh
Beginner


Joined: 19 Mar 2007
Posts: 13
Topics: 5

PostPosted: Mon May 11, 2009 10:22 am    Post subject: Reply with quote

Thank you.
Back to top
View user's profile Send private message
ssanthosh
Beginner


Joined: 19 Mar 2007
Posts: 13
Topics: 5

PostPosted: Mon May 11, 2009 10:26 am    Post subject: Reply with quote

The conversion from S9(13)V9(2) to SX(13).X(2) worked. Is there a way we convert SX(13).X(2) to S9(13)V9(2) using ICETOOL.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Mon May 11, 2009 10:34 am    Post subject: Reply with quote

ssanthosh,

You can use the SFF format to convert it to ZD format

SX(13).X(2) = 17 bytes = SFF format
S9(13)V9(2) = 15 bytes = zd format

Code:

OUTREC OVERLAY=(86:86,17,SFF,ZD,LENGTH=15)

_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ssanthosh
Beginner


Joined: 19 Mar 2007
Posts: 13
Topics: 5

PostPosted: Mon May 11, 2009 10:54 am    Post subject: Reply with quote

I tried this method. The -ve values looks good, where as for the +ve amounts there is a mismatch in the LSB.

Sample data:
=========
Original file: Amount S9(13)V9(2) = 15 bytes:
00000000000535{
00000000005190F
00000000021636H
00000000003700} ... this is -ve amount

After Character conversion: SX(13).X(2) = 17 bytes = SFF format
+0000000000053.50
+0000000000519.06
+0000000002163.68
-0000000000370.00

Final conversion SX(13).X(2) [=17 bytes] to S9(13)V9(2) [=15 bytes]
000000000005350
000000000051906
000000000216368
00000000003700} .. only -ve amount matches the original format

If I could manage to get the data in original format, after intermediate processing that would be great.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Mon May 11, 2009 11:25 am    Post subject: Reply with quote

ssanthosh,

bonk Why do you want to convert it to an intermediate form and convert it back again ? If you want the sign overpunched then you can use ZDC format.

Code:

OUTREC OVERLAY=(86:86,17,SFF,ZDC,LENGTH=15)

_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ssanthosh
Beginner


Joined: 19 Mar 2007
Posts: 13
Topics: 5

PostPosted: Mon May 11, 2009 12:16 pm    Post subject: Reply with quote

Thank you Kolusu. I am converting the amount (ZD format) to Intermediate format(SFF) so that windows server program accomplish the task. After processing, I get another file from windows server (SFF format) and finally I need to run the reconcile program on mainframe. The reconcile program compares both the windows file and the MF dataset. I used OUTREC OVERLAY=(86:86,17,SFF,ZDC,LENGTH=15) to convert from SFF to ZDC but still there is mismatch in original file and converted file (last byte).

Sample data:
Original file: Amount S9(13)V9(2) = 15 bytes:
00000000000535{
00000000005190F
00000000021636H
00000000004883C
00000000002537E

After Character conversion: SX(13).X(2) = 17 bytes = SFF format
+0000000000053.35
+0000000000519.90
+0000000002163.36
+0000000000488.83
+0000000000253.37

Final conversion SX(13).X(2) [=17 bytes] to S9(13)V9(2) [=15 bytes]
00000000000533E
00000000005199{
00000000021633F
00000000004888C
00000000002533G
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Mon May 11, 2009 12:56 pm    Post subject: Reply with quote

ssanthosh,

Something doesn't match , how did 00000000000535{ get converted to +0000000000053.35 ?

If you used sort to convert it , it would be converted to +0000000000053.50 ?

Similarly 00000000005190F will be converted to +0000000000519.06. But you are converting it to +0000000000519.90 , How are you doing that?

this is the reprenstation of the ZD numbers . The number on top represents the sign overpunch and the lower number represents the readable decimal number

Code:

{ABCDEFGHI}JKLMNOPQR
01234567890123456789 

_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ssanthosh
Beginner


Joined: 19 Mar 2007
Posts: 13
Topics: 5

PostPosted: Mon May 11, 2009 1:49 pm    Post subject: Reply with quote

Kolusu.. The file that I am getting from windows is corrupting the cents field:). Thank you so much. Now we know the root cause.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group