View previous topic :: View next topic |
Author |
Message |
haritha_e Beginner
Joined: 30 Jan 2007 Posts: 14 Topics: 8
|
Posted: Wed Mar 14, 2007 12:08 pm Post subject: Converting Binary to Character using DFSort |
|
|
Hi,
I have a date field in my input file, which is binary. I want to convert that binary field into character using DFSORT.
Any help in this regard will be appreciated
Regards
Haritha |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Wed Mar 14, 2007 12:37 pm Post subject: |
|
|
haritha_e,
It is very easy. Assume that your binary date field starts at pos 1 for 4 bytes then you can simply use the following sort card
Code: |
SORT FIELDS=COPY
OUTFIL OUTREC=(1,4,BI,EDIT=(TTTTTTTTT))
|
Hope this helps...
Cheers
kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
saraswathi Beginner
Joined: 08 Dec 2006 Posts: 14 Topics: 8
|
Posted: Thu Mar 15, 2007 4:58 am Post subject: Binary to Numeric Conversion-SORT |
|
|
hi,
i need to convert a data from binary to numeric. you mentioned the syntax for binary to charcter conversion. shall i use the same for numeric conversion?if so what should i give in EDIT?
thanks,
Saraswathi |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Thu Mar 15, 2007 5:29 am Post subject: Re: Binary to Numeric Conversion-SORT |
|
|
saraswathi wrote: | hi,
i need to convert a data from binary to numeric. you mentioned the syntax for binary to charcter conversion. shall i use the same for numeric conversion?if so what should i give in EDIT?
|
Saraswati,
Now please tell us what you mean by numeric? Readable format of binary data or some other format?
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
saraswathi Beginner
Joined: 08 Dec 2006 Posts: 14 Topics: 8
|
Posted: Thu Mar 15, 2007 6:47 am Post subject: Binary to Numeric Conversion-SORT |
|
|
hi,
yes.Its readable format of binary.i tried you code with TTTT option.But if i wish to convert more fields from input file into radable numeric data type what should i do?
say:
X , Y, Z fields in input file are binary.i need to convert them into readable numeric format and write the same in various positions of output file.
thanks,
Saraswathi |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Thu Mar 15, 2007 7:48 am Post subject: |
|
|
saraswathi,
you can code the same for all your binary/packed fields
Code: |
p,m,f,edit=(ttttttt)
p = position of the field you want to convert
m = length of the field
f = format of the field
|
Hope this helps...
Cheers
Kolusu
ps: Stop sending personal emails seeking help. Post all your questions on the helpboard itself _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
Frank Yaeger Sort Forum Moderator

Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
|
Posted: Thu Mar 15, 2007 10:42 am Post subject: |
|
|
A couple of alternatives you can use where n is the length you want for the output field:
p,m,f,M11,LENGTH=n
or
p,m,f,TO=ZD,LENGTH=n
For more information on converting fields with DFSORT, see:
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CG20/2.4.7?DT=20060615173822
and:
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CG20/2.4.8?DT=20060615173822 _________________ 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 |
|
 |
|
|