OT: Quiz/QSHOW extract of packed decimals - Hewlett Packard

This is a discussion on OT: Quiz/QSHOW extract of packed decimals - Hewlett Packard ; Hi all, MPE 6.0 QSHOW 7.29.C8 918RX / 64Mb / 40 users I am trying to extract some data using QSHOW from KSAM and TURBOIMAGE files but some fields appear to include compressed decimals. Our box is under-powered / under-RAM'd: ...

+ Reply to Thread
Results 1 to 6 of 6

Thread: OT: Quiz/QSHOW extract of packed decimals

  1. OT: Quiz/QSHOW extract of packed decimals


    Hi all,

    MPE 6.0
    QSHOW 7.29.C8
    918RX / 64Mb / 40 users

    I am trying to extract some data using QSHOW from KSAM and TURBOIMAGE
    files but some fields appear to include compressed decimals. Our box is
    under-powered / under-RAM'd: It cannot run minisoft ODBC reliably
    especially when the data extracts exceed 10,000 lines per table.

    Has anyone extracted data including fields which decompresses packed
    decimals into something e.g. MS Access or SQL can understand?

    At the moment I can get all the data out to 'plain text' but any field
    where this encoding happens looks like garbage and causes a wordwrap
    that upsets if the numbers encode to 0x0a.

    Regards


    Tony



    Tony Tibbenham
    I.T Manager
    Supersine Duramark Ltd

    Tel:
    +44 (0)1502 527009

    Fax:
    +44 (0)1502 560620

    Mobile:
    +44 (0)7976 602335

    E-Mail:
    ttibbenham@ssdm.co.uk
    Web:
    http://www.ssdm.co.uk/

    With Christmas approaching we would like to advise you in advance that our offices will be closed from Wednesday 24th December 2008 until Monday 5th January 2009.

    Confidentiality: This e-mail and its attachments are intended for the above named only and may be confidential. If they have come to you in error you must take no action based on them, nor must you copy or show them to anyone; please reply to this e-mail and highlight the error.

    Security Warning: Please note that this e-mail has been created in the knowledge that internet e-mail is not a 100% secure communications medium . We advise that you understand and observe this lack of security when e-mailing us.

    Viruses: Although we have taken steps to ensure that this email and attachments are free from any virus, we advise that in keeping with good computing practice the recipient should ensure they are actually virus free.

    Any views expressed in this email are those of the individual and are not necessarily those of the company or any of its subsidiaries.

    Registered Office: Freemantle Road, Lowestoft, Suffolk, NR33 0EA England. Registered in England Under Company Number 02984457 VAT Reg. No 443 0520 90
    A Supersine Holdings Group Company
    EUROPE'S LEADER IN TRANSPORTATION, INTERIOR AND EXTERIOR GRAPHIC SOLUTIONS



    * To join/leave the list, search archives, change list settings, *
    * etc., please visit http://raven.utc.edu/archives/hp3000-l.html *


  2. Re: OT: Quiz/QSHOW extract of packed decimals

    Dear All,

    Apologies for my monster Sig. on the original post. I have been trying
    to tame Outlook + Exchange + Exclaimer with limited success. Hopefully
    this one will be much better.

    This is an example of the code we used ..

    access BACKORDR
    define dl char*1="~"
    report summary &
    SORDER-NO dl &
    SORDER-NO
    set subfile name BAC486 keep portable
    go

    I thought 'keep' meant 'keep the file after you close quiz' and
    'portable' meant 'in a form Access could understand'.
    We define the ~ delimiter because some of the fields have quotes and
    commas in.

    The company did have a Quiz/qshow manual once :-(

    Regards


    Tony
    -----Original Message-----
    John said:

    :Quiz
    >access mytable
    >set subfile myname portable
    >report summary all
    >go


    Note the inclusion of the "portable" option on the subfile statement.

    Regards,
    JWP

    * To join/leave the list, search archives, change list settings, *
    * etc., please visit http://raven.utc.edu/archives/hp3000-l.html *


  3. Re: OT: Quiz extract of encoded fields

    Some more data extraction fun!

    The dictionary has the troublesome fields defined as CHAR(12) so I guess whatever is in them is encoded somehow within the no-longer-supported application. I am no longer convinced this is packed decimals problem.
    Anyone who can suggest how 52 characters ( remembering the leading 0x0a ) are seen in miniterm from a 12 character field.
    " LqMMMM"
    and
    "X8MMMM"
    are both meant to be 12 'character' fields.

    Is there some way to see a hex dump of these files so I can see the real data?
    I suspect the 52 character field has tab characters encoded, for example.

    On the original extract both the above fields include 0x0a, I think, causing the wordwraps which prompted my original extract confusion.

    Dictionary extract:
    DIMENSIONS CHAR X(12)
    ..LENGTH NUM 4 0 4 ^^^^^^.^^^^
    ..WIDTH NUM 4 0 4 ^^^^^^.^^^^
    ..LENGTH-UOM CHAR X(2)
    ..WIDTH-UOM CHAR X(2)
    ..MACHINE-TYPE CHAR X(12)
    ..TOOL-TYPE CHAR X(12)

    FROM quiz > prompt

    set report limit 200
    access BOM-STRUCTURE
    define dl char*1="~"
    report summary &
    COMPANY dl &
    PRODUCT dl &
    PRODUCT-1 dl &
    DEFAULT-QTY dl &
    LENGTH dl &
    LENGTH-UOM dl &
    WIDTH dl &
    WIDTH-UOM dl &
    ITEM-NO dl &
    OFF-DATE dl &
    ON-DATE dl &
    OPTION-FLAG dl &
    PRINT-FLAG dl &
    QTY-PER-ASSEMBLY dl &
    MACHINE-TYPE dl & <<<< These are the ones which throw wierd data
    TOOL-TYPE <<<< These are the ones which throw wierd data
    set subfile name BOM706 portable
    go

    SS~ST~ST~00019 ~FF66 ~+0000000000~+1213158432~+0538976288~ ~ ~ ~+0000000000~+0019911115~TL~ ~+0000000000HOT HOT
    SS~ST~ST~00019 ~P01701 ~+0000000000~+0000455000~+0000115000~MM~MM~ ~+0000000000~+0019950118~RM~ ~+0000001000
    X8MMMM
    X8MMMM
    SS~ST~ST~00020 ~P00308 ~+0000000000~+0000925000~+0000047000~MM~MM~ ~+0000000000~+0019911115~TP~ ~+0000001000

    SS~00020 ~24 ~+0000000000~+1347568979~ ~+1414088517~ ~ ~+0000000000~+0019911115~MC~ ~+0000000000~PRESTIGE ~PRESTIGE
    SS~00021 ~P00308 ~+0000000000~+0000675000~MM~+0000160000~MM~ ~+0000000000~+0019911115~TP~ ~+0000001000~
    LqMMMM~
    LqMMMM
    SS~00021 ~P01701 ~+0000000000~+0000675000~MM~+0000160000~MM~ ~+0000000000~+0019950118~RM~ ~+0000001000~ LqMMMM~
    LqMMMM
    SS~00021 ~111F ~+0000000000~+1213158432~ ~+0538976288~ ~ ~+0000000000~+0019911115~TL~ ~+0000000000~HOT ~HOT

    * To join/leave the list, search archives, change list settings, *
    * etc., please visit http://raven.utc.edu/archives/hp3000-l.html *


  4. Re: OT: Quiz extract of encoded fields

    Thank you all for help on hex dumping and making portable: Easy when you
    know how :-)

    Here are some hex dumps of some encoded character fields after they have
    been made 'portable'. It looks encoded to me. All it is meant to
    contain is the machine name or maybe dimensions.

    Thanks to Tracy I ran:
    FCOPY from=BOM706q;to=;char;hex


    It was examples like this that made me think it was an encoded decimal.
    I could almost picture this being 'some number x some other encoded
    number' with dimesions set to MMxMM
    0038: 3030 307E 0009 B078 0003 C8C0 4D4D 4D4D 000~...x....MMMM
    0040: 7E00 09B0 7800 03C8 C04D 4D4D 4D ~...x....MMMM

    Others are more obscure
    0038: 3030 307E 000C FC38 000A 44E8 4D4D 4D4D 000~...8..D.MMMM
    0040: 7E00 0CFC 3800 0A44 E84D 4D4D 4D ~...8..D.MMMM
    and
    0038: 3030 307E 0018 9CC8 0003 3450 4D4D 4D4D 000~......4PMMMM
    0040: 7E00 189C C800 0334 504D 4D4D 4D ~......4PMMMM

    An understandable example
    0038: 3030 307E 5356 4543 4941 2020 2020 2020 000~SVECIA
    0040: 7E53 5645 4349 4120 2020 2020 20 ~SVECIA

    And one which caused the line wrap in the ASCII import - see the 00 0A
    on block 40
    BOM706Q RECORD 17 (%21, #11)

    0000: 5353 7E30 3030 3231 2020 2020 2020 207E SS~00021 ~
    0008: 5030 3137 3031 2020 2020 2020 7E2B 3030 P01701 ~+00
    0010: 3030 3030 3030 3030 7E2B 3030 3030 3637 00000000~+000067
    0018: 3530 3030 7E4D 4D7E 2B30 3030 3031 3630 5000~MM~+0000160
    0020: 3030 307E 4D4D 7E20 207E 2B30 3030 3030 000~MM~ ~+00000
    0028: 3030 3030 307E 2B30 3031 3939 3530 3131 00000~+001995011
    0030: 387E 524D 7E20 207E 2B30 3030 3030 3031 8~RM~ ~+0000001
    0038: 3030 307E 000A 4CB8 0002 7100 4D4D 4D4D 000~..L...q.MMMM
    0040: 7E00 0A4C B800 0271 004D 4D4D 4D ~..L...q.MMMM

    So .. the field is dual-purpose but does sometimes, we infer, contain
    useful information that we want to extract.
    Observations:
    - The encoded field either has plain ASCII or starts with 00
    - All encoded examples seem, so far, to end with 4D 4D 4D 4D aka MMMM

    Regards,


    Tony

    * To join/leave the list, search archives, change list settings, *
    * etc., please visit http://raven.utc.edu/archives/hp3000-l.html *


  5. Re: OT: Quiz extract of encoded fields

    Tony

    Your dictionary definition:

    Dictionary extract:
    DIMENSIONS CHAR X(12)
    ..LENGTH NUM 4 0 4 ^^^^^^.^^^^
    ..WIDTH NUM 4 0 4 ^^^^^^.^^^^
    ..LENGTH-UOM CHAR X(2)
    ..WIDTH-UOM CHAR X(2)
    ..MACHINE-TYPE CHAR X(12)
    ..TOOL-TYPE CHAR X(12)

    The field according to Image is a 12 character field. According to
    Powerhouse it can contain one of three things: dimensions, machine type
    or tool type. It will be up to you to figure out how to tell which to
    expect.

    When the field contains dimensions it seems to be made up of four data
    values, namely length, width and two unit of measure fields. For those
    records in which the last four characters are "MMMM" I would suggest
    that these records contain dimensions and the "MMMM" is the unit of
    measure codes for both length and width.

    You will need to go back to Qshow and display the record layout for your
    input file to confirm the actual format of the two numeric fields. It
    seems likely that they are both Integer Size 4 but they might be
    something else.

    Your extract will need to decide what the 12 character field contains
    and then decode accordingly. I would use several define statements to
    keep the extracted data clean. This is one of the prices you pay for
    "overloaded" fields. Something like:

    Define d-length zoned*4 &
    = length if [whatever tells you it contains dimensions] &
    Else 0
    Define d-width zoned*4 &
    = width if [whatever tells you it contains dimensions] &
    Else 0
    Define d-length-uom char*2 &
    = length-uom if [whatever tells you it contains dimensions] &
    Else ""
    Define d-width-uom char*2 &
    = width-uom if [whatever tells you it contains dimensions] &
    Else ""
    Define d-machine-type char*12 &
    = machine-type if [whatever tells you it contains machine type] &
    Else ""
    Define d-tool-type char*12 &
    = tool-type if [whatever tells you it contains tool type] &
    Else ""

    Then you should include the defined items instead of the corresponding
    record items in your subfile.

    JWP


    -----Original Message-----
    From: HP-3000 Systems Discussion [mailto:HP3000-L@RAVEN.UTC.EDU] On
    Behalf Of Tony Tibbenham
    Sent: Tuesday, October 07, 2008 1:13 PM
    To: HP3000-L@RAVEN.UTC.EDU
    Subject: Re: [HP3000-L] OT: Quiz extract of encoded fields

    Thank you all for help on hex dumping and making portable: Easy when you
    know how :-)

    Here are some hex dumps of some encoded character fields after they have
    been made 'portable'. It looks encoded to me. All it is meant to
    contain is the machine name or maybe dimensions.

    Thanks to Tracy I ran:
    FCOPY from=BOM706q;to=;char;hex


    It was examples like this that made me think it was an encoded decimal.
    I could almost picture this being 'some number x some other encoded
    number' with dimesions set to MMxMM
    0038: 3030 307E 0009 B078 0003 C8C0 4D4D 4D4D 000~...x....MMMM
    0040: 7E00 09B0 7800 03C8 C04D 4D4D 4D ~...x....MMMM

    Others are more obscure
    0038: 3030 307E 000C FC38 000A 44E8 4D4D 4D4D 000~...8..D.MMMM
    0040: 7E00 0CFC 3800 0A44 E84D 4D4D 4D ~...8..D.MMMM
    and
    0038: 3030 307E 0018 9CC8 0003 3450 4D4D 4D4D 000~......4PMMMM
    0040: 7E00 189C C800 0334 504D 4D4D 4D ~......4PMMMM

    An understandable example
    0038: 3030 307E 5356 4543 4941 2020 2020 2020 000~SVECIA
    0040: 7E53 5645 4349 4120 2020 2020 20 ~SVECIA

    And one which caused the line wrap in the ASCII import - see the 00 0A
    on block 40
    BOM706Q RECORD 17 (%21, #11)

    0000: 5353 7E30 3030 3231 2020 2020 2020 207E SS~00021 ~
    0008: 5030 3137 3031 2020 2020 2020 7E2B 3030 P01701 ~+00
    0010: 3030 3030 3030 3030 7E2B 3030 3030 3637 00000000~+000067
    0018: 3530 3030 7E4D 4D7E 2B30 3030 3031 3630 5000~MM~+0000160
    0020: 3030 307E 4D4D 7E20 207E 2B30 3030 3030 000~MM~ ~+00000
    0028: 3030 3030 307E 2B30 3031 3939 3530 3131 00000~+001995011
    0030: 387E 524D 7E20 207E 2B30 3030 3030 3031 8~RM~ ~+0000001
    0038: 3030 307E 000A 4CB8 0002 7100 4D4D 4D4D 000~..L...q.MMMM
    0040: 7E00 0A4C B800 0271 004D 4D4D 4D ~..L...q.MMMM

    So .. the field is dual-purpose but does sometimes, we infer, contain
    useful information that we want to extract.
    Observations:
    - The encoded field either has plain ASCII or starts with 00
    - All encoded examples seem, so far, to end with 4D 4D 4D 4D aka MMMM

    Regards,


    Tony

    * To join/leave the list, search archives, change list settings, *
    * etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

    * To join/leave the list, search archives, change list settings, *
    * etc., please visit http://raven.utc.edu/archives/hp3000-l.html *


  6. Re: OT: Quiz extract of encoded fields

    Dear John,

    Sorry for the delay in replying.
    Thank you for your clear and informative post. I had not encountered
    overloaded fields before so had been wondering how 36 characters could
    be defined for a 12 character field.

    With this foundation I shall re-approach the extract after deciding how
    to differentiate the fields.

    Regards


    Tony


    * To join/leave the list, search archives, change list settings, *
    * etc., please visit http://raven.utc.edu/archives/hp3000-l.html *


+ Reply to Thread