HP3000-L Archives

February 2011, Week 2

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
"Newton, Ernie" <[log in to unmask]>
Reply To:
Newton, Ernie
Date:
Tue, 8 Feb 2011 20:43:56 +0000
Content-Type:
text/plain
Parts/Attachments:
text/plain (186 lines)
Thank you very much Neil.
That worked beautifully.
Go ahead and take the rest of the week off.
Ernie
-----Original Message-----
From: Neil Armstrong [mailto:[log in to unmask]]
Sent: Tuesday, February 08, 2011 11:44 AM
To: Newton, Ernie; [log in to unmask]
Subject: RE: [HP3000-L] Suprtool question

Dear Ernie,

I assumed a depth of 5 as this is what my test suite often uses, here is one method, it's a bit ugly but it should work. We could add some MPE programming to handle n-number of data-items, but I will leave that up to you.

{ Extract a single digit for counting per key item }
>get mydataset
>def count,1,4,double
>ext key-item
>ext data-item
>ext count=1
>if data-item > 9000
>out ernie2,link
>xeq
{ Subtotal based on key Item }
>in ernie2
>form
    File: ERNIE2.NEIL.GREEN     (SD Version B.00.00)
       Entry:                     Offset
          KEY-ITEM             X16     1
          DATA-ITEM            Z8     17
          COUNT                I2     25
    Limit: 10000  EOF: 15  Entry Length: 28  Blocking: 64
>sort key-item
>ext key-item
>ext data-item
>def mycount,1,14,packed
>ext mycount=$subtotal(count,key-item)
>out ernie3,link
>xeq
{ Split the files }
:purge table1
:purge table2
:purge table3
:purge table4
:purge table5
in ernie3
if mycount=1
sort key-item
out table1,link
xeq
IN=15, OUT=5. CPU-Sec=1. Wall-Sec=1.

in ernie3
sort key-item
if mycount=2
out table2,link
xeq
IN=15, OUT=4. CPU-Sec=1. Wall-Sec=1.

in ernie3
sort key-item
if mycount=3
out table3,link
xeq
IN=15, OUT=3. CPU-Sec=1. Wall-Sec=1.

in ernie3
sort key-item
if mycount=4
out table4,link
xeq
IN=15, OUT=2. CPU-Sec=1. Wall-Sec=1.

in ernie3
sort key-item
if mycount=5
out table5,link
xeq
IN=15, OUT=1. CPU-Sec=1. Wall-Sec=1.

{Now combine per key }
:purge final
table table2,key-item,sorted,table2,data(data-item)

Warning:  Source of input records not specified yet There are 4 entries in TABLE2 table table3,key-item,sorted,table3,data(data-item)

Warning:  Source of input records not specified yet There are 3 entries in TABLE3 table table4,key-item,sorted,table4,data(data-item)

Warning:  Source of input records not specified yet There are 2 entries in TABLE4 table table5,key-item,sorted,table5,data(data-item)

Warning:  Source of input records not specified yet There are 1 entries in TABLE5 def data-item2,1,8,display def data-item3,1,8,display def data-item4,1,8,display def data-item5,1,8,display in table1 ext key-item ext data-item ext data-item2=$lookup(table2,key-item,data-item)
ext data-item3=$lookup(table3,key-item,data-item)
ext data-item4=$lookup(table4,key-item,data-item)
ext data-item5=$lookup(table5,key-item,data-item)
out final,link
xeq
IN=5, OUT=5. CPU-Sec=1. Wall-Sec=1.

>in final
>list
>xeq
>IN FINAL.NEIL.GREEN (0) >OUT $NULL (0)
KEY-ITEM        = 11111
DATA-ITEM       = 11111          DATA-ITEM2      = 0
DATA-ITEM3      = 0              DATA-ITEM4      = 0
DATA-ITEM5      = 0

>IN FINAL.NEIL.GREEN (1) >OUT $NULL (1)
KEY-ITEM        = 22222
DATA-ITEM       = 22222          DATA-ITEM2      = 22222
DATA-ITEM3      = 0              DATA-ITEM4      = 0
DATA-ITEM5      = 0

>IN FINAL.NEIL.GREEN (2) >OUT $NULL (2)
KEY-ITEM        = 33333
DATA-ITEM       = 33333          DATA-ITEM2      = 33333
DATA-ITEM3      = 33333          DATA-ITEM4      = 0
DATA-ITEM5      = 0

>IN FINAL.NEIL.GREEN (3) >OUT $NULL (3)
KEY-ITEM        = 44444
DATA-ITEM       = 44444          DATA-ITEM2      = 44444
DATA-ITEM3      = 44444          DATA-ITEM4      = 44444
DATA-ITEM5      = 0

>IN FINAL.NEIL.GREEN (4) >OUT $NULL (4)
KEY-ITEM        = 55555
DATA-ITEM       = 55555          DATA-ITEM2      = 55555
DATA-ITEM3      = 55555          DATA-ITEM4      = 55555
DATA-ITEM5      = 55555

IN=5, OUT=5. CPU-Sec=1. Wall-Sec=1.

>in final
>out *,prn
>xeq
"11111           ",11111    ,0        ,0        ,0        ,0
"22222           ",22222    ,22222    ,0        ,0        ,0
"33333           ",33333    ,33333    ,33333    ,0        ,0
"44444           ",44444    ,44444    ,44444    ,44444    ,0
"55555           ",55555    ,55555    ,55555    ,55555    ,55555
IN=5, OUT=5. CPU-Sec=1. Wall-Sec=1.

>


-----Original Message-----
From: HP-3000 Systems Discussion [mailto:[log in to unmask]] On Behalf Of Newton, Ernie
Sent: February-08-11 1:31 PM
To: [log in to unmask]
Subject: [HP3000-L] Suprtool question

Greetings,

Here's a dataset...

MYDATASET
                KEY-ITEM             X16         <<Search Field>>
                DATA-ITEM         Z8

I want to find DATA-ITEM > 9000 and there will be some KEY-ITEM entries with more than one DATA-ITEM > 9000, some KEY-ITEM entries will have only one DATA-ITEM > 9000.

Can Suprtool give me one record for each KEY-ITEM and concatenate multiple DATA-ITEMS?

I'm wanting a comma-delimited file using OUTPUT FILENAME PRN.

Thanks,

Ernie


________________________________

This message, including any attachments, is intended solely for the use of the named recipient(s) and may contain confidential and/or privileged information. Any unauthorized review, use, disclosure or distribution of this communication(s) is expressly prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy any and all copies of the original message.

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


________________________________

This message, including any attachments, is intended solely for the use of the named recipient(s) and may contain confidential and/or privileged information. Any unauthorized review, use, disclosure or distribution of this communication(s) is expressly prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy any and all copies of the original message.

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

ATOM RSS1 RSS2