Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Binary to Char Conversion using Sort

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Binary to Char Conversion using Sort
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

Site Director


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

PostPosted: Mon Feb 09, 2009 11:57 am    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Mon Feb 09, 2009 9:26 pm    Post subject:
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 Moderator


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

PostPosted: Mon Feb 09, 2009 11:12 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORT to unpack a feild shr_amar DFSORT/ICETOOL 7 Fri Jul 07, 2017 4:32 am
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts Optimize sort inrec parse vishwakotin DFSORT/ICETOOL 6 Mon Jun 26, 2017 11:15 pm
No new posts Reduce CPU Times for Join Sort santoshn SYNCSORT 12 Sat Jun 10, 2017 1:40 pm
No new posts Db2 load job abending in SORT mistah kurtz DB2 4 Mon Jun 05, 2017 3:58 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us