Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

unpack parameter

by Anonymous Monk
on Apr 17, 2013 at 18:38 UTC ( #1029196=perlquestion: print w/replies, xml ) Need Help??

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I am trying to unpack some data...
ethnicity 115 1 Char(1) height 116 2 DEF FIXED(3,0) weight 118 2 DEF FIXED(3,0)
I can unpack ethnicity with 'a1'...what format do I use to unpack (3,0)?

Replies are listed 'Best First'.
Re: unpack parameter
by BrowserUk (Patriarch) on Apr 17, 2013 at 19:44 UTC
    what format do I use to unpack (3,0)?

    It depends upon what DEF FIXED(3,0) means; and that depends upon the language (programming or specification) that is being used and which you haven't identified.

    It doesn't correspond to (my memory of) COBOL nor any variant of SQL I am familiar with.

    Unless you can identify what programming or data definition language the specification is written in, you are not going to get anything more than guesses.

    Is the document from which you drew the spec publicly linked?

    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
      no it's not (publicly linked)...thanks for your reply.
Re: unpack parameter
by Illuminatus (Curate) on Apr 17, 2013 at 19:44 UTC
    You'll need to provide more info if you want help. I'm assuming this is a portion of a database schema. Most databases I know of use DECIMAL, not FIXED. Whatever database you are using should have documentation somewhere about internal data format. How you're retrieving this info, and what the documentation says about how it returns data would be your next step


Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1029196]
Approved by kcott
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2022-05-26 01:21 GMT
Find Nodes?
    Voting Booth?
    Do you prefer to work remotely?

    Results (91 votes). Check out past polls.