DB2 convert digits to binary format


 
Thread Tools Search this Thread
Top Forums Programming DB2 convert digits to binary format
Prev   Next
# 1  
Old 05-03-2018
DB2 convert digits to binary format

Dear Team

We use DB2 v10.5 and using DBArtisan tool

Can someone please guide how to convert digits to binary numbers using db2 feature.
HTML Code:
Ex> for number 9 , binary should be 1001 ( 8+1)
Any help appreciated. Thanks
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Programming

DB2 Query -Convert multi values from column to rows

Hi Team I am using DB2 artisan tool and struck to handle multi values present in columns that are comma(,) separated. I want to convert those column values in separate rows . For example : Column 1 Column2 Jan,Feb Hold,Sell,Buy Expected Result Column1 ... (3 Replies)
Discussion started by: Perlbaby
3 Replies

2. Shell Programming and Scripting

Convert jpg file to binary format

Hi Team, Here's the requirement. I have a image file in jpg format in unix. Now I need to i. convert the jpg format to binary format ii. followed by loading the binary file to Oracle db. Can anyone help me out? Thanks Krishnakanth Manivannan (4 Replies)
Discussion started by: kmanivan82
4 Replies

3. Shell Programming and Scripting

Perl Script remove digits and convert

Hello Guy's Quick question which im sure many can answer in seconds. Basically I have a perl script which is running commands to an element and then taking some of the the output and printing it to the screen. One of the outputs is a variable Hex Number. What I would like to do is strip... (1 Reply)
Discussion started by: mutley2202
1 Replies

4. Shell Programming and Scripting

Convert binary file to csv and then back to the binary format

Hello *nix specialists, Im working for a non profit organisation in Germany to transport DSL over WLAN to people in areas without no DSL. We are using Linksys WRT 54 router with DD-WRT firmware There are at the moment over 180 router running but we have to change some settings next time. So my... (7 Replies)
Discussion started by: digidax
7 Replies

5. Shell Programming and Scripting

summing the digits of a binary nuMBER

please help me write a perl program to find the difference of 1 and zeros of a 6 digit binary number. eg If input is 111100 expected output +2 if input is 000011 expected output -2 input is 000111 expected output 0 (2 Replies)
Discussion started by: dll_fpga
2 Replies

6. Shell Programming and Scripting

Need to represent a number in 99999999 format(8 digits)

Hi all, i have to create a file having an 8-digit sequence number, that will start by name file_00000001.cvs at first time, the next day the file will be named file_00000002.cvs and so on. How can i do this in my script please, specially that i will need a counter that increments this number... (10 Replies)
Discussion started by: Eman_in_forum
10 Replies

7. Shell Programming and Scripting

Get the places of binary digits in the korn shell script

TO THE ALMIGHTY FORUM , though i have already posted the same question on hex to binary thread , i am posting here also for other beginners who may benefit from this thread... I have a 32 bit binary containing a series of 1' and 0's , and i am stuck... (2 Replies)
Discussion started by: venu
2 Replies

8. Shell Programming and Scripting

Is there any script which convert binary file to CSV format

Dear guys; I have a binary file and I need to convert its data to csv format ...appreciating your help. Best Regards (14 Replies)
Discussion started by: ahmad.diab
14 Replies

9. Shell Programming and Scripting

How to convert a column to last five digits

Hi Suppose I have a input.csv file like this Fort, 2034440-3333 Honda, b293489289 Toyota, 23423000 How to convert the second column to the following format, there are only two cases: a.if the last five character is a hyphen plus four numeric digit, keep the the last five digits... (6 Replies)
Discussion started by: grossgermany
6 Replies

10. UNIX for Dummies Questions & Answers

To convert multi format file to a readable ascii format

Hi I have a file which has ascii , binary, binary decimal coded,decimal & hexadecimal data with lot of special characters (like öƒ.ƒ.„İİ¡Š·œƒ.„İİ¡Š· ) in it. I want to standardize the file into ASCII format & later use that as source . Can any one suggest a way a logic to convert such... (5 Replies)
Discussion started by: gaur.deepti
5 Replies
Login or Register to Ask a Question
Math::BaseCalc(3pm)					User Contributed Perl Documentation				       Math::BaseCalc(3pm)

NAME
Math::BaseCalc - Convert numbers between various bases VERSION
version 1.016 SYNOPSIS
use Math::BaseCalc; my $calc = new Math::BaseCalc(digits => [0,1]); #Binary my $bin_string = $calc->to_base(465); # Convert 465 to binary $calc->digits('oct'); # Octal my $number = $calc->from_base('1574'); # Convert octal 1574 to decimal DESCRIPTION
This module facilitates the conversion of numbers between various number bases. You may define your own digit sets, or use any of several predefined digit sets. The to_base() and from_base() methods convert between Perl numbers and strings which represent these numbers in other bases. For instance, if you're using the binary digit set [0,1], $calc->to_base(5) will return the string "101". $calc->from_base("101") will return the number 5. To convert between, say, base 7 and base 36, use the 2-step process of first converting to a Perl number, then to the desired base for the result: $calc7 = new Math::BaseCalc(digits=>[0..6]); $calc36 = new Math::BaseCalc(digits=>[0..9,'a'..'z']); $in_base_36 = $calc36->to_base( $calc7->from_base('3506') ); If you just need to handle regular octal & hexdecimal strings, you probably don't need this module. See the sprintf(), oct(), and hex() Perl functions. METHODS
o new Math::BaseCalc o new Math::BaseCalc(digits=>...) Create a new base calculator. You may specify the digit set to use, by either giving the digits in a list reference (in increasing order, with the 'zero' character first in the list) or by specifying the name of one of the predefined digit sets (see the digit() method below). If your digit set includes the character "-", then a dash at the beginning of a number will no longer signify a negative number. o $calc->to_base(NUMBER) Converts a number to a string representing that number in the associated base. If "NUMBER" is a "Math::BigInt" object, "to_base()" will still work fine and give you an exact result string. o $calc->from_base(STRING) Converts a string representing a number in the associated base to a Perl integer. The behavior when fed strings with characters not in $calc's digit set is currently undefined. If "STRING" converts to a number too large for perl's integer representation, beware that the result may be auto-converted to a floating-point representation and thus only be an approximation. o $calc->digits o $calc->digits(...) Get/set the current digit set of the calculator. With no arguments, simply returns a list of the characters that make up the current digit set. To change the current digit set, pass a list reference containing the new digits, or the name of a predefined digit set. Currently the predefined digit sets are: bin => [0,1], hex => [0..9,'a'..'f'], HEX => [0..9,'A'..'F'], oct => [0..7], 64 => ['A'..'Z','a'..'z',0..9,'+','/'], 62 => [0..9,'a'..'z','A'..'Z'], Examples: $calc->digits('bin'); $calc->digits([0..7]); $calc->digits([qw(w a l d o)]); If any of your "digits" has more than one character, the behavior is currently undefined. QUESTIONS
The '64' digit set is meant to be useful for Base64 encoding. I took it from the MIME::Base64.pm module. Does it look right? It's sure in a strange order. AUTHOR
Ken Williams, ken@forum.swarthmore.edu COPYRIGHT
This is free software in the colloquial nice-guy sense of the word. Copyright (c) 1999, Ken Williams. You may redistribute and/or modify it under the same terms as Perl itself. SEE ALSO
perl(1). perl v5.12.3 2011-05-16 Math::BaseCalc(3pm)