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 

Converting Binary to Character using DFSort

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


Joined: 30 Jan 2007
Posts: 14
Topics: 8

PostPosted: Wed Mar 14, 2007 12:08 pm    Post subject: Converting Binary to Character using DFSort Reply with quote

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


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

PostPosted: Wed Mar 14, 2007 12:37 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
saraswathi
Beginner


Joined: 08 Dec 2006
Posts: 14
Topics: 8

PostPosted: Thu Mar 15, 2007 4:58 am    Post subject: Binary to Numeric Conversion-SORT Reply with quote

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


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

PostPosted: Thu Mar 15, 2007 5:29 am    Post subject: Re: Binary to Numeric Conversion-SORT Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
saraswathi
Beginner


Joined: 08 Dec 2006
Posts: 14
Topics: 8

PostPosted: Thu Mar 15, 2007 6:47 am    Post subject: Binary to Numeric Conversion-SORT Reply with quote

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


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

PostPosted: Thu Mar 15, 2007 7:48 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


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

PostPosted: Thu Mar 15, 2007 10:42 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
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