<?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: sort assistance in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/sort-assistance/m-p/4004887#M83865</link>
    <description>Phil,&lt;BR /&gt;&lt;BR /&gt;I never cease to be amazed by what VMS can do - if you know the magic incantation.  This is an "almost" - what that means is I'll have to play with it and see what else I can try - thank your for showing me this train of thought!  (see below)&lt;BR /&gt;&lt;BR /&gt;Hein,&lt;BR /&gt;&lt;BR /&gt;I had to "tweak" a few thing in the DCL .com file, but I'm still having a problem with the f$fao statement - it gives me **** instead of NLP device #'s, so I'll be playing with that some more too. I expect when I get it working (I'm an optimist :^) I'll post it for others to reference.&lt;BR /&gt;&lt;BR /&gt;Thank you both for your thoughts &amp;amp; time&lt;BR /&gt;&lt;BR /&gt;Rich&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;nlp_dev = NLP0    pq_num2 = PQE9    Inum = i27664    Ip_Addr = 10.10.55.108   MAC_Addr = 00:0e:7f:37:d3:97    Type =  JetDirect 17xÂ &lt;BR /&gt;nlp_dev = NLP1    pq_num2 = PQTS    Inum = is0061    Ip_Addr = 10.33.49.106   MAC_Addr = 00:00:C9:03:4E:31    Type =  NetQue PS 1  Â &lt;BR /&gt;nlp_dev = NLP2    pq_num2 = PQPG    Inum = i14052    Ip_Addr = 10.98.17.175   MAC_Addr = 00:00:C9:0A:64:24    Type =  NetQue PS 2  Â &lt;BR /&gt;nlp_dev = NLP4    pq_num2 = PQZG    Inum = i11584    Ip_Addr = 10.130.33.88   MAC_Addr = 00:00:C9:09:0C:B2    Type =  NetQue PS 2  Â &lt;BR /&gt;nlp_dev = NLP5    pq_num2 = PQ74    Inum = i30941    Ip_Addr = 10.65.49.210   MAC_Addr = 00:11:0a:bf:74:50    Type =  JetDirect 17xÂ &lt;BR /&gt;nlp_dev = NLP6    pq_num2 = PQ76    Inum = i26817    Ip_Addr = 10.194.80.200   MAC_Addr = 00:11:0a:bb:dc:4c    Type =  JetDirect 17Â &lt;BR /&gt;nlp_dev = NLP7    pq_num2 = PQ72    Inum = i17922    Ip_Addr = 10.67.81.46   MAC_Addr = 00:01:e6:5d:de:75    Type =  JetDirect 17x Â &lt;BR /&gt;nlp_dev = NLP8    pq_num2 = PQAT    Inum = i01604    Ip_Addr = 10.10.27.204   MAC_Addr = 00:00:C9:09:85:C3    Type =  NetQue PS 2  Â &lt;BR /&gt;nlp_dev = NLP9    pq_num2 = PQB6    Inum = i29829    Ip_Addr = 10.194.80.220   MAC_Addr = 00:11:0a:bf:0d:42    Type =  JetDirect 17Â &lt;BR /&gt;nlp_dev = NLP10    pq_num2 = PQAV    Inum = i01665    Ip_Addr = 10.69.33.171   MAC_Addr = 00:01:e6:a5:21:e2    Type =  JetDirect 17Â &lt;BR /&gt;nlp_dev = NLP20    pq_num2 = PQSJ    Inum = i14741    Ip_Addr = 10.161.17.60   MAC_Addr = 00:01:e6:35:a7:73    Type =  JetDirect 17Â &lt;BR /&gt;nlp_dev = NLP30    pq_num2 = PQBF    Inum = i33009    Ip_Addr = 10.194.32.162   MAC_Addr = 00:11:0a:f1:78:89    Type =  JetDirect 1Â &lt;BR /&gt;nlp_dev = NLP40    pq_num2 = PQXM    Inum = i04835    Ip_Addr = 10.193.1.23   MAC_Addr = 00:00:C9:08:9A:47    Type =  NetQue PS 2  Â &lt;BR /&gt;nlp_dev = NLP50    pq_num2 = PQQL    Inum = i13938    Ip_Addr = 10.10.31.125   MAC_Addr = Ã -:::::    Type =    Que_Name = PQQL     Â &lt;BR /&gt;nlp_dev = NLP60    pq_num2 = PQ10    Inum = i30908    Ip_Addr = 10.195.32.244   MAC_Addr = 00:11:0a:bf:f7:30    Type =  JetDirect 1Â &lt;BR /&gt;nlp_dev = NLP70    pq_num2 = PQ27    Inum = i20384    Ip_Addr = 10.10.38.106   MAC_Addr = 00:01:e6:7a:8c:7b    Type =  JetDirect 17Â &lt;BR /&gt;nlp_dev = NLP80    pq_num2 = PQ08    Inum = i21884    Ip_Addr = 10.194.32.213   MAC_Addr = 00:01:e6:75:b5:ed    Type =  JetDirect 1Â &lt;BR /&gt;nlp_dev = NLP90    pq_num2 = PQ50    Inum = i04703    Ip_Addr = 10.7.38.96   MAC_Addr = 00:00:C9:08:99:B2    Type =  NetQue PS 2   Â &lt;BR /&gt;nlp_dev = NLP11    pq_num2 = PQAV    Inum = i01665    Ip_Addr = 10.69.33.171   MAC_Addr = 00:01:e6:a5:21:e2    Type =  JetDirect 17Â &lt;BR /&gt;nlp_dev = NLP21    pq_num2 = PQOG    Inum = i01008    Ip_Addr = 10.194.64.177   MAC_Addr = 00:11:0a:ba:bf:51    Type =  JetDirect 1Â &lt;BR /&gt;nlp_dev = NLP31    pq_num2 = PQBH    Inum = i20817    Ip_Addr = 10.10.55.102   MAC_Addr = 00:01:e6:4d:2a:62    Type =  JetDirect 17Â &lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Tue, 22 May 2007 20:43:48 GMT</pubDate>
    <dc:creator>Rich Hearn</dc:creator>
    <dc:date>2007-05-22T20:43:48Z</dc:date>
    <item>
      <title>sort assistance</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/sort-assistance/m-p/4004881#M83859</link>
      <description>I'm sure I'm missing the obvious, but I haven't been able to see it yet.  I'm trying to sort a file in numerical order 0000 - 9999 (nlp devs).  Presently, 101 is after 1009 (see below), I'd like to be able to have 0-9, 10-99, 100-999,1000-999 in "normal" decimal order - not computer sort order.  What am I failing to understand so I can create the correct collate sequence?  I've tried:&lt;BR /&gt;&lt;BR /&gt;/collat=(sequence=("0"-"9","10"-"99","100"-"999","1000"-"9998"))&lt;BR /&gt;&lt;BR /&gt;CACHE1::DISK$INFSYS:[RJHEARN]_&amp;gt;sort/key=(pos:11,size:8)/spec=seq5.dat pq_list.txt  pq_list.srt&lt;BR /&gt;%SORT-F-SPCIVC, invalid collating sequence specification, at line 7&lt;BR /&gt;&lt;BR /&gt;nlp_dev = NLP1&lt;BR /&gt;nlp_dev = NLP10&lt;BR /&gt;nlp_dev = NLP100&lt;BR /&gt;nlp_dev = NLP1000&lt;BR /&gt;nlp_dev = NLP1001&lt;BR /&gt;nlp_dev = NLP1002&lt;BR /&gt;nlp_dev = NLP1003&lt;BR /&gt;nlp_dev = NLP1004&lt;BR /&gt;nlp_dev = NLP1005&lt;BR /&gt;nlp_dev = NLP1006&lt;BR /&gt;nlp_dev = NLP1007&lt;BR /&gt;nlp_dev = NLP1008&lt;BR /&gt;nlp_dev = NLP1009 &lt;BR /&gt;nlp_dev = NLP101&lt;BR /&gt;nlp_dev = NLP1010&lt;BR /&gt;&lt;BR /&gt;Thanks for thoughts,&lt;BR /&gt;Rich&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 22 May 2007 07:57:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/sort-assistance/m-p/4004881#M83859</guid>
      <dc:creator>Rich Hearn</dc:creator>
      <dc:date>2007-05-22T07:57:24Z</dc:date>
    </item>
    <item>
      <title>Re: sort assistance</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/sort-assistance/m-p/4004882#M83860</link>
      <description>I'm afraid you can not get there from here.&lt;BR /&gt;VMS Sort is strictly fixed field driven.&lt;BR /&gt;&lt;BR /&gt;You would have to process the data witha  program of dcl script to align, sort, reformat.&lt;BR /&gt;&lt;BR /&gt;How much data is there?&lt;BR /&gt;It's a trivial one-line excercise in perl.&lt;BR /&gt;For example:&lt;BR /&gt;&lt;BR /&gt;perl -e "@lines=&amp;lt;&amp;gt;; print sort{substr($a,13) &amp;lt;=&amp;gt; substr($b,13)} @lines" x.txt&lt;BR /&gt;&lt;BR /&gt;In slow motion:&lt;BR /&gt;&lt;BR /&gt;perl -e "  !  Program on command line&lt;BR /&gt;@lines=&amp;lt;&amp;gt;; !  Suck input stream into array lines&lt;BR /&gt;print      !  &lt;BR /&gt;sort       ! Invoke sort on an array, normally comparing the whole array lines as text&lt;BR /&gt;{}         ! Sort function to use&lt;BR /&gt;here:&lt;BR /&gt;{substr($a,13) ! Grab character from column 13 onwards from left &lt;BR /&gt; &amp;lt;=&amp;gt;       !  Compare as integers (versus cmp)&lt;BR /&gt; substr($b,13)}  ! other value to compare&lt;BR /&gt;@lines"    ! The array with input &lt;BR /&gt;x.txt      ! They data&lt;BR /&gt;&lt;BR /&gt;hth,&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
      <pubDate>Tue, 22 May 2007 09:02:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/sort-assistance/m-p/4004882#M83860</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2007-05-22T09:02:31Z</dc:date>
    </item>
    <item>
      <title>Re: sort assistance</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/sort-assistance/m-p/4004883#M83861</link>
      <description>Hein,&lt;BR /&gt;&lt;BR /&gt;Thank you for the response.  Tho' it's not the "preferred" answer, I can, at least, move on and sort the file using DCL (I don't have Perl on our systems) instead of continuing to try to get the /collat= statement correct.&lt;BR /&gt;&lt;BR /&gt;Rich&lt;BR /&gt;</description>
      <pubDate>Tue, 22 May 2007 09:36:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/sort-assistance/m-p/4004883#M83861</guid>
      <dc:creator>Rich Hearn</dc:creator>
      <dc:date>2007-05-22T09:36:37Z</dc:date>
    </item>
    <item>
      <title>Re: sort assistance</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/sort-assistance/m-p/4004884#M83862</link>
      <description>Here is the core of how how I would do it in DCL:&lt;BR /&gt;&lt;BR /&gt;$open/read in 'p1&lt;BR /&gt;$tmp = "sys$login:sort.tmp"&lt;BR /&gt;$open/write tmp 'tmp&lt;BR /&gt;$loop:&lt;BR /&gt;$read/end=sort_it in in_record&lt;BR /&gt;$out_record = f$extr(0,13,in_record) + f$fao("!5UL",'f$ext(13,99,in_record)')&lt;BR /&gt;$write tmp out_record&lt;BR /&gt;$goto loop&lt;BR /&gt;$sort_it:&lt;BR /&gt;$close in&lt;BR /&gt;$close tmp&lt;BR /&gt;$sort/key=(pos=13,siz=5) 'tmp 'tmp&lt;BR /&gt;$open/read tmp 'tmp&lt;BR /&gt;$open/write out 'p1&lt;BR /&gt;$loop2:&lt;BR /&gt;$read/end=done/err=done tmp in_record&lt;BR /&gt;$out_record =  f$extr(0,13,in_record) + f$edit(f$ext(13,99,in_record),"trim")&lt;BR /&gt;$write out out_record&lt;BR /&gt;$goto loop2&lt;BR /&gt;$done:&lt;BR /&gt;$close tmp&lt;BR /&gt;$close out&lt;BR /&gt;$delete 'tmp';*&lt;BR /&gt;</description>
      <pubDate>Tue, 22 May 2007 10:19:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/sort-assistance/m-p/4004884#M83862</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2007-05-22T10:19:25Z</dc:date>
    </item>
    <item>
      <title>Re: sort assistance</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/sort-assistance/m-p/4004885#M83863</link>
      <description>Hein,&lt;BR /&gt;&lt;BR /&gt;Thanks for the example - I'll give it "a whirl" and see how it does.  Either way, I appreciate your assistance and willingness to help.&lt;BR /&gt;&lt;BR /&gt;Tnx agn,&lt;BR /&gt;Rich&lt;BR /&gt;</description>
      <pubDate>Tue, 22 May 2007 10:59:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/sort-assistance/m-p/4004885#M83863</guid>
      <dc:creator>Rich Hearn</dc:creator>
      <dc:date>2007-05-22T10:59:07Z</dc:date>
    </item>
    <item>
      <title>Re: sort assistance</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/sort-assistance/m-p/4004886#M83864</link>
      <description>SORT/STAT/KEY=(POS:17,SIZ:1)/KEY=(POS:16,SIZ:2)/KEY=(POS:15,SIZ:3)/KEY=(POS:14,SIZ:4)&lt;BR /&gt;Phil</description>
      <pubDate>Tue, 22 May 2007 19:56:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/sort-assistance/m-p/4004886#M83864</guid>
      <dc:creator>Phil.Howell</dc:creator>
      <dc:date>2007-05-22T19:56:17Z</dc:date>
    </item>
    <item>
      <title>Re: sort assistance</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/sort-assistance/m-p/4004887#M83865</link>
      <description>Phil,&lt;BR /&gt;&lt;BR /&gt;I never cease to be amazed by what VMS can do - if you know the magic incantation.  This is an "almost" - what that means is I'll have to play with it and see what else I can try - thank your for showing me this train of thought!  (see below)&lt;BR /&gt;&lt;BR /&gt;Hein,&lt;BR /&gt;&lt;BR /&gt;I had to "tweak" a few thing in the DCL .com file, but I'm still having a problem with the f$fao statement - it gives me **** instead of NLP device #'s, so I'll be playing with that some more too. I expect when I get it working (I'm an optimist :^) I'll post it for others to reference.&lt;BR /&gt;&lt;BR /&gt;Thank you both for your thoughts &amp;amp; time&lt;BR /&gt;&lt;BR /&gt;Rich&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;nlp_dev = NLP0    pq_num2 = PQE9    Inum = i27664    Ip_Addr = 10.10.55.108   MAC_Addr = 00:0e:7f:37:d3:97    Type =  JetDirect 17xÂ &lt;BR /&gt;nlp_dev = NLP1    pq_num2 = PQTS    Inum = is0061    Ip_Addr = 10.33.49.106   MAC_Addr = 00:00:C9:03:4E:31    Type =  NetQue PS 1  Â &lt;BR /&gt;nlp_dev = NLP2    pq_num2 = PQPG    Inum = i14052    Ip_Addr = 10.98.17.175   MAC_Addr = 00:00:C9:0A:64:24    Type =  NetQue PS 2  Â &lt;BR /&gt;nlp_dev = NLP4    pq_num2 = PQZG    Inum = i11584    Ip_Addr = 10.130.33.88   MAC_Addr = 00:00:C9:09:0C:B2    Type =  NetQue PS 2  Â &lt;BR /&gt;nlp_dev = NLP5    pq_num2 = PQ74    Inum = i30941    Ip_Addr = 10.65.49.210   MAC_Addr = 00:11:0a:bf:74:50    Type =  JetDirect 17xÂ &lt;BR /&gt;nlp_dev = NLP6    pq_num2 = PQ76    Inum = i26817    Ip_Addr = 10.194.80.200   MAC_Addr = 00:11:0a:bb:dc:4c    Type =  JetDirect 17Â &lt;BR /&gt;nlp_dev = NLP7    pq_num2 = PQ72    Inum = i17922    Ip_Addr = 10.67.81.46   MAC_Addr = 00:01:e6:5d:de:75    Type =  JetDirect 17x Â &lt;BR /&gt;nlp_dev = NLP8    pq_num2 = PQAT    Inum = i01604    Ip_Addr = 10.10.27.204   MAC_Addr = 00:00:C9:09:85:C3    Type =  NetQue PS 2  Â &lt;BR /&gt;nlp_dev = NLP9    pq_num2 = PQB6    Inum = i29829    Ip_Addr = 10.194.80.220   MAC_Addr = 00:11:0a:bf:0d:42    Type =  JetDirect 17Â &lt;BR /&gt;nlp_dev = NLP10    pq_num2 = PQAV    Inum = i01665    Ip_Addr = 10.69.33.171   MAC_Addr = 00:01:e6:a5:21:e2    Type =  JetDirect 17Â &lt;BR /&gt;nlp_dev = NLP20    pq_num2 = PQSJ    Inum = i14741    Ip_Addr = 10.161.17.60   MAC_Addr = 00:01:e6:35:a7:73    Type =  JetDirect 17Â &lt;BR /&gt;nlp_dev = NLP30    pq_num2 = PQBF    Inum = i33009    Ip_Addr = 10.194.32.162   MAC_Addr = 00:11:0a:f1:78:89    Type =  JetDirect 1Â &lt;BR /&gt;nlp_dev = NLP40    pq_num2 = PQXM    Inum = i04835    Ip_Addr = 10.193.1.23   MAC_Addr = 00:00:C9:08:9A:47    Type =  NetQue PS 2  Â &lt;BR /&gt;nlp_dev = NLP50    pq_num2 = PQQL    Inum = i13938    Ip_Addr = 10.10.31.125   MAC_Addr = Ã -:::::    Type =    Que_Name = PQQL     Â &lt;BR /&gt;nlp_dev = NLP60    pq_num2 = PQ10    Inum = i30908    Ip_Addr = 10.195.32.244   MAC_Addr = 00:11:0a:bf:f7:30    Type =  JetDirect 1Â &lt;BR /&gt;nlp_dev = NLP70    pq_num2 = PQ27    Inum = i20384    Ip_Addr = 10.10.38.106   MAC_Addr = 00:01:e6:7a:8c:7b    Type =  JetDirect 17Â &lt;BR /&gt;nlp_dev = NLP80    pq_num2 = PQ08    Inum = i21884    Ip_Addr = 10.194.32.213   MAC_Addr = 00:01:e6:75:b5:ed    Type =  JetDirect 1Â &lt;BR /&gt;nlp_dev = NLP90    pq_num2 = PQ50    Inum = i04703    Ip_Addr = 10.7.38.96   MAC_Addr = 00:00:C9:08:99:B2    Type =  NetQue PS 2   Â &lt;BR /&gt;nlp_dev = NLP11    pq_num2 = PQAV    Inum = i01665    Ip_Addr = 10.69.33.171   MAC_Addr = 00:01:e6:a5:21:e2    Type =  JetDirect 17Â &lt;BR /&gt;nlp_dev = NLP21    pq_num2 = PQOG    Inum = i01008    Ip_Addr = 10.194.64.177   MAC_Addr = 00:11:0a:ba:bf:51    Type =  JetDirect 1Â &lt;BR /&gt;nlp_dev = NLP31    pq_num2 = PQBH    Inum = i20817    Ip_Addr = 10.10.55.102   MAC_Addr = 00:01:e6:4d:2a:62    Type =  JetDirect 17Â &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 22 May 2007 20:43:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/sort-assistance/m-p/4004887#M83865</guid>
      <dc:creator>Rich Hearn</dc:creator>
      <dc:date>2007-05-22T20:43:48Z</dc:date>
    </item>
    <item>
      <title>Re: sort assistance</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/sort-assistance/m-p/4004888#M83866</link>
      <description>Rich,&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt;&lt;BR /&gt;but I'm still having a problem with the f$fao statement - it gives me **** instead &lt;BR /&gt;&amp;lt;&amp;lt;&amp;lt;&lt;BR /&gt;&lt;BR /&gt;are you sure you took the correct use of apostrophes from the example?&lt;BR /&gt;As far as I can see it seems correct. But that error usually impleis some type conversion issue.&lt;BR /&gt;If necessary. take the detour of first doing the string extraction into a symbol, and then usinf the value of that symbol in the F$FAO.&lt;BR /&gt;&lt;BR /&gt;hth&lt;BR /&gt;&lt;BR /&gt;Proost.&lt;BR /&gt;&lt;BR /&gt;Have one on me.&lt;BR /&gt;&lt;BR /&gt;jpe</description>
      <pubDate>Tue, 22 May 2007 20:52:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/sort-assistance/m-p/4004888#M83866</guid>
      <dc:creator>Jan van den Ende</dc:creator>
      <dc:date>2007-05-22T20:52:20Z</dc:date>
    </item>
    <item>
      <title>Re: sort assistance</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/sort-assistance/m-p/4004889#M83867</link>
      <description>Jan,&lt;BR /&gt;&lt;BR /&gt;I'll have to spend some more time looking into it tomorrow - the 45 minutes I've spent tonight hasn't yielded any luck, so I'll pick it up in the morning&lt;BR /&gt;&lt;BR /&gt;Thanks for the thought though...&lt;BR /&gt;Rich&lt;BR /&gt;</description>
      <pubDate>Tue, 22 May 2007 21:23:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/sort-assistance/m-p/4004889#M83867</guid>
      <dc:creator>Rich Hearn</dc:creator>
      <dc:date>2007-05-22T21:23:49Z</dc:date>
    </item>
    <item>
      <title>Re: sort assistance</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/sort-assistance/m-p/4004890#M83868</link>
      <description>Phil, that sort does not work for me:&lt;BR /&gt;&lt;BR /&gt;$ SORT/STAT/KEY=(POS:17,SIZ:1)/KEY=(POS:16,SIZ:2)/KEY=(POS:15,SIZ:3)/KEY=(POS:14,SIZ:4) tmp.tmp tt:&lt;BR /&gt;nlp_dev = NLP1&lt;BR /&gt;nlp_dev = NLP2&lt;BR /&gt;nlp_dev = NLP10&lt;BR /&gt;nlp_dev = NLP11&lt;BR /&gt;nlp_dev = NLP114&lt;BR /&gt;nlp_dev = NLP105&lt;BR /&gt;nlp_dev = NLP2001&lt;BR /&gt;nlp_dev = NLP1002&lt;BR /&gt;nlp_dev = NLP2002&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Rich,&lt;BR /&gt;Did my example at least work with the data example you published?&lt;BR /&gt;Your real data (next time, attach as text file to original topic?!) does not 'end' after the number but has 'stuff'.&lt;BR /&gt;So the DCL needs to extract not 'the rest', but just up to the first space in the tail.&lt;BR /&gt;&lt;BR /&gt;The sorting subroutine in perl gets more challenging also, needing to 'match' against decimals following NPL up to the next word 'break' (space, or EOL).&lt;BR /&gt;&lt;BR /&gt;Perl:&lt;BR /&gt;perl -e "@lines=&amp;lt;&amp;gt;; print sort{$a=~/NLP(\d+)\b/; $x=$1; $b=~/NLP(\d+)\b/; $x&amp;lt;=&amp;gt;$1} @lines" tmp.tmp&lt;BR /&gt;&lt;BR /&gt;DCL:&lt;BR /&gt;&lt;BR /&gt;$close/nolog in&lt;BR /&gt;$close/nolog out&lt;BR /&gt;$close/nolog tmp&lt;BR /&gt;$open/read in 'p1&lt;BR /&gt;$tmp = "sys$login:sort.tmp"&lt;BR /&gt;$out = p2&lt;BR /&gt;$if out.eqs."" then out = p1&lt;BR /&gt;$open/write tmp 'tmp&lt;BR /&gt;$loop:&lt;BR /&gt;$read/end=sort_it in in_record&lt;BR /&gt;$tail = f$ext(13,999,in_record)&lt;BR /&gt;$space = f$loc(" ",tail)&lt;BR /&gt;$out_record = f$extr(0,13,in_record) + -&lt;BR /&gt;        f$fao("!5UL",'f$extr(0,space,tail)') + -&lt;BR /&gt;        f$extr(space,999,tail)&lt;BR /&gt;$write tmp out_record&lt;BR /&gt;$goto loop&lt;BR /&gt;$sort_it:&lt;BR /&gt;$close in&lt;BR /&gt;$close tmp&lt;BR /&gt;$sort/key=(pos=14,siz=5) 'tmp 'tmp&lt;BR /&gt;$open/read tmp 'tmp&lt;BR /&gt;$open/write out 'out&lt;BR /&gt;$loop2:&lt;BR /&gt;$read/end=done/err=done tmp in_record&lt;BR /&gt;$out_record =  f$extr(0,13,in_record) + -&lt;BR /&gt;        f$edit(f$ext(13,5,in_record),"trim") + -&lt;BR /&gt;        f$extr(13+5,999,in_record)&lt;BR /&gt;$write out out_record&lt;BR /&gt;$goto loop2&lt;BR /&gt;$done:&lt;BR /&gt;$close tmp&lt;BR /&gt;$close out&lt;BR /&gt;$delete 'tmp';*&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 22 May 2007 22:41:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/sort-assistance/m-p/4004890#M83868</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2007-05-22T22:41:26Z</dc:date>
    </item>
    <item>
      <title>Re: sort assistance</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/sort-assistance/m-p/4004891#M83869</link>
      <description>Hein,&lt;BR /&gt;&lt;BR /&gt;If I understand your question, I did have to make a couple of "adjustments" to the original .com you posted.  I didn't post the data file because it's ~600 vms blocks in length.  I have zip'd it up and attached it if you're interested. I should have done this originally - lesson learned.  Your original .com gave me enough to work with, so I was just going to keep working with it until I had it working correctly (for me).&lt;BR /&gt;&lt;BR /&gt;Since I can't see the previous responses once in this forum editor, I can't tell you which of my responses had the output you asked about.  I don't remember which response I gave that had a result of the modified original .com file.&lt;BR /&gt;&lt;BR /&gt;Tnx,&lt;BR /&gt;Rich&lt;BR /&gt;</description>
      <pubDate>Thu, 24 May 2007 07:31:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/sort-assistance/m-p/4004891#M83869</guid>
      <dc:creator>Rich Hearn</dc:creator>
      <dc:date>2007-05-24T07:31:34Z</dc:date>
    </item>
    <item>
      <title>Re: sort assistance</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/sort-assistance/m-p/4004892#M83870</link>
      <description>&amp;gt;&amp;gt; I did have to make a couple of "adjustments" to the original .com you posted. &lt;BR /&gt;&lt;BR /&gt;There is a date header line in the date which needs to be excluded (see below)&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt;attached it if you're interested. &lt;BR /&gt;The script below works on that data file.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt; Since I can't see the previous responses once in this forum editor, &lt;BR /&gt;&lt;BR /&gt;I always grab a second window to reply (^N in exploder) leaving the original, closing the extra after the acknowledgement.&lt;BR /&gt;&lt;BR /&gt;Hein&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;$ type tmp.com&lt;BR /&gt;$close/nolog in&lt;BR /&gt;$close/nolog out&lt;BR /&gt;$close/nolog tmp&lt;BR /&gt;$open/read in 'p1&lt;BR /&gt;$tmp = "sys$login:sort.tmp"&lt;BR /&gt;$out = p2&lt;BR /&gt;$if out.eqs."" then out = p1&lt;BR /&gt;$open/write tmp 'tmp&lt;BR /&gt;$read in date_record&lt;BR /&gt;$loop:&lt;BR /&gt;$read/end=sort_it in in_record&lt;BR /&gt;$tail = f$ext(13,999,in_record)&lt;BR /&gt;$space = f$loc(" ",tail)&lt;BR /&gt;$out_record = f$extr(0,13,in_record) + -&lt;BR /&gt;        f$fao("!5UL",'f$extr(0,space,tail)') + -&lt;BR /&gt;        f$extr(space,999,tail)&lt;BR /&gt;$write tmp out_record&lt;BR /&gt;$goto loop&lt;BR /&gt;$sort_it:&lt;BR /&gt;$close in&lt;BR /&gt;$close tmp&lt;BR /&gt;$sort/key=(pos=14,siz=5) 'tmp 'tmp&lt;BR /&gt;$open/read tmp 'tmp&lt;BR /&gt;$open/write out 'out&lt;BR /&gt;$write out date_record&lt;BR /&gt;$loop2:&lt;BR /&gt;$read/end=done/err=done tmp in_record&lt;BR /&gt;$out_record =  f$extr(0,13,in_record) + -&lt;BR /&gt;        f$edit(f$ext(13,5,in_record),"trim") + -&lt;BR /&gt;        f$extr(13+5,999,in_record)&lt;BR /&gt;$write out out_record&lt;BR /&gt;$goto loop2&lt;BR /&gt;$done:&lt;BR /&gt;$close tmp&lt;BR /&gt;$close out&lt;BR /&gt;$!delete 'tmp';*&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 24 May 2007 09:31:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/sort-assistance/m-p/4004892#M83870</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2007-05-24T09:31:26Z</dc:date>
    </item>
    <item>
      <title>Re: sort assistance</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/sort-assistance/m-p/4004893#M83871</link>
      <description>Hein,&lt;BR /&gt;&lt;BR /&gt;I can only say "Thank You" for your efforts &amp;amp; patience.  Yes, the DCL .com does, indeed, work - quite nice.  Now, I'll have a look at what *I* wasn't doing correctly so I'll know for future reference. &lt;BR /&gt;&lt;BR /&gt;Thanks, also, for your thoughts of 2 windows - I'll be doing that from now on.  &lt;BR /&gt;&lt;BR /&gt;Thank you again for all your help,&lt;BR /&gt;Rich&lt;BR /&gt;</description>
      <pubDate>Thu, 24 May 2007 10:37:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/sort-assistance/m-p/4004893#M83871</guid>
      <dc:creator>Rich Hearn</dc:creator>
      <dc:date>2007-05-24T10:37:39Z</dc:date>
    </item>
  </channel>
</rss>

