<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: data manipuation using in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/data-manipuation-using/m-p/5006429#M35406</link>
    <description>Hello again Laura,&lt;BR /&gt;&lt;BR /&gt;This would be a perfect task for Datatrieve!&lt;BR /&gt;Perhaps you have that installed on your system? Perhaps you should?&lt;BR /&gt;&lt;BR /&gt;You can do it with DCL as before.&lt;BR /&gt;And you could break up the record in chunks and glue them together. But I would just replace, in place.&lt;BR /&gt;&lt;BR /&gt;The fields you need to change now are NOT part of the primary key, so an in-place update is fine. No need for delete + write.&lt;BR /&gt;&lt;BR /&gt;You need something like my early reply to:&lt;BR /&gt;&lt;A href="http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1059083" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1059083&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;UNTESTED:&lt;BR /&gt;1) make a backup first?!&lt;BR /&gt;2) add /SHARE=WRITE to first open if needed.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;$open/read/write tmp circuit.dat&lt;BR /&gt;$i = 0&lt;BR /&gt;$u = 0&lt;BR /&gt;$loop:&lt;BR /&gt;$i = i + 1   ! Count record&lt;BR /&gt;$read/end=done tmp record&lt;BR /&gt;$if "XG".nes.F$EXTR(205,2,record) then goto loop&lt;BR /&gt;$&lt;BR /&gt;$! Found XG, check first field to replace.&lt;BR /&gt;$&lt;BR /&gt;$prim = F$EXTR(0,38,record)&lt;BR /&gt;$WNPGMB01TTC = F$EXTR(352,11,record)&lt;BR /&gt;$if WNPGMB01TTC .NES. "WNPGMB01TTC"&lt;BR /&gt;$then &lt;BR /&gt;$ write sys$output "record ''i', primary=''prim' XG + X=''WNPGMB01TTC'"&lt;BR /&gt;$ goto loop&lt;BR /&gt;$endif&lt;BR /&gt;$&lt;BR /&gt;$! First field to replace OK, check second.&lt;BR /&gt;$&lt;BR /&gt;$WNPGMB01TTC = F$EXTR(504,11,record)&lt;BR /&gt;$if WNPGMB01TTC .NES. "WNPGMB01TTC"&lt;BR /&gt;$then &lt;BR /&gt;$ write sys$output "record ''i', primary=''prim' XG + Y=''WNPGMB01TTC'"&lt;BR /&gt;$ goto loop&lt;BR /&gt;$&lt;BR /&gt;$! Found XG and two fields were ok. Update!&lt;BR /&gt;$ &lt;BR /&gt;$u = u + 1&lt;BR /&gt;$record[352,11] := "WNPIMBTVTOC"&lt;BR /&gt;$record[504,11] := "WNPIMBTVTOC"&lt;BR /&gt;$write/update/symbol tmp record&lt;BR /&gt;$goto loop&lt;BR /&gt;$&lt;BR /&gt;$done:&lt;BR /&gt;$write sys$output "''i' records read, ''u' updates'"&lt;BR /&gt;$close tmp&lt;BR /&gt;&lt;BR /&gt;Cheers.&lt;BR /&gt;Hein</description>
    <pubDate>Mon, 02 Oct 2006 17:33:36 GMT</pubDate>
    <dc:creator>Hein van den Heuvel</dc:creator>
    <dc:date>2006-10-02T17:33:36Z</dc:date>
    <item>
      <title>data manipuation using</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/data-manipuation-using/m-p/5006428#M35405</link>
      <description>I have need to change two fields in a file.&lt;BR /&gt;$if "XG".eqs.F$EXTR(205,2,record)&lt;BR /&gt;&lt;BR /&gt;Then replace WNPGMB01TTC with WNPIMBTVTOC at the 352 char pos (11 char length) and at the 504 char pos (11 char length)&lt;BR /&gt;&lt;BR /&gt;I have used the following script, thanks to Heins, but this is not a swap of 1 field to another, but a replacement of one word for another.&lt;BR /&gt;&lt;BR /&gt;So I am trying to wrap my head around it.&lt;BR /&gt;&lt;BR /&gt;Appreciate any help.&lt;BR /&gt;Laura&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;$old = "CIRCUIT.DAT;4"&lt;BR /&gt;$new = "CIRCUIT.new;4"&lt;BR /&gt;$fdl = "CIRCUIT.FDL;4"&lt;BR /&gt;$tmp = "tmp.tmp"&lt;BR /&gt;$mod = 0&lt;BR /&gt;$num = 0&lt;BR /&gt;$&lt;BR /&gt;$close/nolog old&lt;BR /&gt;$close/nolog tmp&lt;BR /&gt;$creat/fdl=sys$input 'tmp&lt;BR /&gt;file; allo 20000; exte 5000; record; size 773; form fixed&lt;BR /&gt;$open/appe tmp 'tmp&lt;BR /&gt;$open/read old 'old&lt;BR /&gt;$&lt;BR /&gt;$loop:&lt;BR /&gt;$read/end=done  old record&lt;BR /&gt;$num = num + 1&lt;BR /&gt;$if "XG".eqs.F$EXTR(205,2,record)&lt;BR /&gt;$then&lt;BR /&gt;$ mod = mod + 1&lt;BR /&gt;$&lt;BR /&gt;$ old_key = F$EXTR(00,38,record)&lt;BR /&gt;$ new_key = F$EXTR(86,38,record)&lt;BR /&gt;$ mid     = F$EXTR(38,48,record)&lt;BR /&gt;$ rest    = F$EXTR(124,999,record)&lt;BR /&gt;$ record  = new_key + mid + old_key + rest&lt;BR /&gt;$&lt;BR /&gt;$ if mod.lt.3&lt;BR /&gt;$then&lt;BR /&gt;$   write sys$output "Record ''num', Old=''old_key', New=''New_key'"&lt;BR /&gt;$   sample = num&lt;BR /&gt;$endif&lt;BR /&gt;$&lt;BR /&gt;$endif&lt;BR /&gt;$write/symbol tmp record&lt;BR /&gt;$goto loop&lt;BR /&gt;$&lt;BR /&gt;$done:&lt;BR /&gt;$write sys$output "''num' records read, ''mod' modified."&lt;BR /&gt;$close old&lt;BR /&gt;$close tmp&lt;BR /&gt;$dump /record=(count=1,start='sample') 'tmp&lt;BR /&gt;$conv/stat/fast/sort/fdl='fdl' 'tmp 'new /EXCEPT=circuit.exception&lt;BR /&gt;$exit</description>
      <pubDate>Mon, 02 Oct 2006 16:21:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/data-manipuation-using/m-p/5006428#M35405</guid>
      <dc:creator>Ratzie</dc:creator>
      <dc:date>2006-10-02T16:21:00Z</dc:date>
    </item>
    <item>
      <title>Re: data manipuation using</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/data-manipuation-using/m-p/5006429#M35406</link>
      <description>Hello again Laura,&lt;BR /&gt;&lt;BR /&gt;This would be a perfect task for Datatrieve!&lt;BR /&gt;Perhaps you have that installed on your system? Perhaps you should?&lt;BR /&gt;&lt;BR /&gt;You can do it with DCL as before.&lt;BR /&gt;And you could break up the record in chunks and glue them together. But I would just replace, in place.&lt;BR /&gt;&lt;BR /&gt;The fields you need to change now are NOT part of the primary key, so an in-place update is fine. No need for delete + write.&lt;BR /&gt;&lt;BR /&gt;You need something like my early reply to:&lt;BR /&gt;&lt;A href="http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1059083" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1059083&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;UNTESTED:&lt;BR /&gt;1) make a backup first?!&lt;BR /&gt;2) add /SHARE=WRITE to first open if needed.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;$open/read/write tmp circuit.dat&lt;BR /&gt;$i = 0&lt;BR /&gt;$u = 0&lt;BR /&gt;$loop:&lt;BR /&gt;$i = i + 1   ! Count record&lt;BR /&gt;$read/end=done tmp record&lt;BR /&gt;$if "XG".nes.F$EXTR(205,2,record) then goto loop&lt;BR /&gt;$&lt;BR /&gt;$! Found XG, check first field to replace.&lt;BR /&gt;$&lt;BR /&gt;$prim = F$EXTR(0,38,record)&lt;BR /&gt;$WNPGMB01TTC = F$EXTR(352,11,record)&lt;BR /&gt;$if WNPGMB01TTC .NES. "WNPGMB01TTC"&lt;BR /&gt;$then &lt;BR /&gt;$ write sys$output "record ''i', primary=''prim' XG + X=''WNPGMB01TTC'"&lt;BR /&gt;$ goto loop&lt;BR /&gt;$endif&lt;BR /&gt;$&lt;BR /&gt;$! First field to replace OK, check second.&lt;BR /&gt;$&lt;BR /&gt;$WNPGMB01TTC = F$EXTR(504,11,record)&lt;BR /&gt;$if WNPGMB01TTC .NES. "WNPGMB01TTC"&lt;BR /&gt;$then &lt;BR /&gt;$ write sys$output "record ''i', primary=''prim' XG + Y=''WNPGMB01TTC'"&lt;BR /&gt;$ goto loop&lt;BR /&gt;$&lt;BR /&gt;$! Found XG and two fields were ok. Update!&lt;BR /&gt;$ &lt;BR /&gt;$u = u + 1&lt;BR /&gt;$record[352,11] := "WNPIMBTVTOC"&lt;BR /&gt;$record[504,11] := "WNPIMBTVTOC"&lt;BR /&gt;$write/update/symbol tmp record&lt;BR /&gt;$goto loop&lt;BR /&gt;$&lt;BR /&gt;$done:&lt;BR /&gt;$write sys$output "''i' records read, ''u' updates'"&lt;BR /&gt;$close tmp&lt;BR /&gt;&lt;BR /&gt;Cheers.&lt;BR /&gt;Hein</description>
      <pubDate>Mon, 02 Oct 2006 17:33:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/data-manipuation-using/m-p/5006429#M35406</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2006-10-02T17:33:36Z</dc:date>
    </item>
    <item>
      <title>Re: data manipuation using</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/data-manipuation-using/m-p/5006430#M35407</link>
      <description>Another option for data manipulation is to use sort - with specification files.&lt;BR /&gt;This is also a lot faster than dcl with large data sets.&lt;BR /&gt;see this link for examples&lt;BR /&gt;&lt;A href="http://h71000.www7.hp.com/doc/73final/6489/6489pro_026.html" target="_blank"&gt;http://h71000.www7.hp.com/doc/73final/6489/6489pro_026.html&lt;/A&gt;&lt;BR /&gt;Phil&lt;BR /&gt;</description>
      <pubDate>Mon, 02 Oct 2006 18:31:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/data-manipuation-using/m-p/5006430#M35407</guid>
      <dc:creator>Phil.Howell</dc:creator>
      <dc:date>2006-10-02T18:31:49Z</dc:date>
    </item>
    <item>
      <title>Re: data manipuation using</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/data-manipuation-using/m-p/5006431#M35408</link>
      <description>&lt;BR /&gt;&lt;BR /&gt;I agree, that in general bulk data processing is best done with tools like SORT or PERL or a dedicated COBOL program (apply deferred write) and so on.&lt;BR /&gt;&lt;BR /&gt;But in this case, assuming we are about to update less that 10% of the records, &lt;BR /&gt;&lt;BR /&gt;DCL will actually do about as well as anything else albeit in a clumsy manner. DTR &lt;BR /&gt;&lt;BR /&gt;would be most elegant and clear. Actually, even SQL on a PC through an ODBC tool would probably be fine also.&lt;BR /&gt;&lt;BR /&gt;Why would DCL do well (according to my expectations)? Well, in an other topic Laura showed this was an Indexed file. All 'normal' tools will read indexed files a bucket at a time through RMS. DTR will, Cobol will, DCL will, Sort will.&lt;BR /&gt;DCL wil only have one buffer, but that's all it needs for read next, read next,...&lt;BR /&gt;When an update candidate is found, DCL will tell RMS to update it in this one buffer causing one write IO. That's about as well as anything can do (barring deferred write and some luck that a subsequent update happens to the same bucket. &lt;BR /&gt;&lt;BR /&gt;Hmm, must double check whether unchanged alternate keys cause IOs, I don't think so).&lt;BR /&gt;&lt;BR /&gt;Yeah, Cobol, Basic, C or anything else really will burn less user CPU cycles figuring out what to do next, but that is hardly going to have an impact on top of the RMS $GETs and $UPDATES resource usage.&lt;BR /&gt;&lt;BR /&gt;The only things which could speed this up is a tool which can read more than 1 bucket per IO at a time. I know of some: Freeware DIX, my Tune_check, and a commercial tools like "EGH SELECT" and Syncsort. SELECT (aka Vselect) and probably Synsort also, could readily generate a file with records to be updated, quicker than anything else out there.&lt;BR /&gt;&lt;BR /&gt;For this case, I suspect it is more critical, to jsut get the job done.&lt;BR /&gt;If these kind of questions come back though, then a investing (learning, aquisition) of a tool like Datatrieve, DIX, SELECT or Syncsort would quickly earn its keep.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Hein&lt;BR /&gt;HvdH Performance Consulting.</description>
      <pubDate>Mon, 02 Oct 2006 22:52:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/data-manipuation-using/m-p/5006431#M35408</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2006-10-02T22:52:52Z</dc:date>
    </item>
    <item>
      <title>Re: data manipuation using</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/data-manipuation-using/m-p/5006432#M35409</link>
      <description>Hi Hein thanks again for all the userful information.&lt;BR /&gt;&lt;BR /&gt;I get an error when I run the script. &lt;BR /&gt;&lt;BR /&gt;%DCL-E-INVIFNEST, invalid IF-THEN-ELSE nesting structure or data inconsistency&lt;BR /&gt;&lt;BR /&gt;I have no idea, I believe it is part of the if statement...</description>
      <pubDate>Tue, 03 Oct 2006 20:13:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/data-manipuation-using/m-p/5006432#M35409</guid>
      <dc:creator>Ratzie</dc:creator>
      <dc:date>2006-10-03T20:13:30Z</dc:date>
    </item>
    <item>
      <title>Re: data manipuation using</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/data-manipuation-using/m-p/5006433#M35410</link>
      <description>&lt;!--!*#--&gt;Perhaps a "$endif" after the second&lt;BR /&gt;"$ goto loop"?</description>
      <pubDate>Tue, 03 Oct 2006 21:14:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/data-manipuation-using/m-p/5006433#M35410</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2006-10-03T21:14:16Z</dc:date>
    </item>
    <item>
      <title>Re: data manipuation using</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/data-manipuation-using/m-p/5006434#M35411</link>
      <description>&lt;BR /&gt;Well, I said DCL would be more or less on par for performance but it is not. &lt;BR /&gt;Not on my RX2620. It burns way to much CPU. &lt;BR /&gt;Things like a logical name translation for each and every "$READ file record" does not help.&lt;BR /&gt;&lt;BR /&gt;Here are some experiment numbers:&lt;BR /&gt;&lt;BR /&gt;GB file, 10.1M records @300 bytes, &lt;BR /&gt;10K selected records, 7% buckets split&lt;BR /&gt;RX2620, 73GB 15Krpm drive (LDdriver)&lt;BR /&gt;&lt;BR /&gt;Tool     IO       CPU   Elapsed&lt;BR /&gt;-------------------------------&lt;BR /&gt;DCL      400,000  14:12   16:38 &lt;BR /&gt;SEARCH   400,000  03:09   04:55&lt;BR /&gt;SELECT    74,400  00:25   01:46&lt;BR /&gt;SELECT/A 108,000  00:33   01:54&lt;BR /&gt;Tune*     72,000  00:20   01:00&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;More fragmentation (18% buckets split)&lt;BR /&gt;(more, smalle, clumps/batches of record)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Tool     IO       CPU   Elapsed&lt;BR /&gt;-------------------------------&lt;BR /&gt;DCL      427,000  14:41   17:57&lt;BR /&gt;DIX*     421,000  04:45   07:52 &lt;BR /&gt;SEARCH   421,000  03:34   06:35&lt;BR /&gt;SELECT    98,000  00:23   02:15&lt;BR /&gt;SELECT/A 114,000  00:35   01:59&lt;BR /&gt;Tune*    109,000  00:45   01:23&lt;BR /&gt;&lt;BR /&gt;*: reads all data and counts, but does not select.&lt;BR /&gt;&lt;BR /&gt;DIX /FAST has great potential... but did not work on my test file.&lt;BR /&gt;&lt;A href="http://oooovms.dyndns.org/dix/" target="_blank"&gt;http://oooovms.dyndns.org/dix/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Load data...&lt;BR /&gt;Initial 10.0M record load (presorted), and&lt;BR /&gt;additional 100K record add (random clumps)&lt;BR /&gt;&lt;BR /&gt;Tool     IO       CPU   Elapsed&lt;BR /&gt;-------------------------------&lt;BR /&gt;Convert   61,000  00:59   04:16&lt;BR /&gt;Frag 7%  147,000  00:20   05:13&lt;BR /&gt;Frag 18  357,000  00:45   13:00 &lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
      <pubDate>Tue, 03 Oct 2006 23:52:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/data-manipuation-using/m-p/5006434#M35411</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2006-10-03T23:52:04Z</dc:date>
    </item>
    <item>
      <title>Re: data manipuation using</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/data-manipuation-using/m-p/5006435#M35412</link>
      <description>Thanks</description>
      <pubDate>Thu, 08 Feb 2007 14:21:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/data-manipuation-using/m-p/5006435#M35412</guid>
      <dc:creator>Ratzie</dc:creator>
      <dc:date>2007-02-08T14:21:41Z</dc:date>
    </item>
  </channel>
</rss>

