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

Binary to Char Conversion using Sort


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
subramanianup
Warnings : 1

New User


Joined: 18 May 2005
Posts: 46
Location: Bangalore, INDIA

PostPosted: Mon Feb 09, 2009 11:42 am
Reply with quote

Hi,

In Input File i have first 4 bytes as Binary field(That is Key filed in the File and it is unsigned filed) and Using Sort I need to Convert the 4 byte Binary filed to CHAR Field. Can someone help how to get solution for this?

Thanks,
Subramanian
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 Feb 09, 2009 11:57 am
Reply with quote

Hello,

Please post a few sample input records and the output you want when these input records are processed. Mention how wide the output char field should be. Also mention the recfm and lrecl of the files.
Back to top
View user's profile Send private message
subramanianup
Warnings : 1

New User


Joined: 18 May 2005
Posts: 46
Location: Bangalore, INDIA

PostPosted: Mon Feb 09, 2009 2:16 pm
Reply with quote

Input Layout(When HEX On) Record Length is 80
2C4A TEXT1....
2E1A TEXT1....

Output Required Record Lengh is 80
11338
11802
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 Feb 09, 2009 9:26 pm
Reply with quote

Hello,

Your input is length 4 and the output might be length 5 (as posted). Should the "text" be shifted to the right or remain as is?
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: Mon Feb 09, 2009 11:12 pm
Reply with quote

Subramanian,

2C4A is 2 bytes (X'2C4A'), not 4 bytes. If the input field is 2 bytes and you just want to display it as character (without the other fields in the record), you can use these DFSORT statements:

Code:

  OPTION COPY                                 
  INREC BUILD=(1,2,BI,EDIT=(TTTTT))           


If the input field is 4 bytes (e.g. X'00002C4A'), you can use:

Code:

  OPTION COPY                                 
  INREC BUILD=(1,4,BI,EDIT=(TTTTT))           


If that's not what you want, then you need to do a better job of explaining what you do want.
Back to top
View user's profile Send private message
subramanianup
Warnings : 1

New User


Joined: 18 May 2005
Posts: 46
Location: Bangalore, INDIA

PostPosted: Tue Feb 10, 2009 11:46 am
Reply with quote

Thanks Frank I got the expected Solution. It is working fine
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts 10 byte RBA conversion DB2 2
Search our Forums:

Back to Top