Re: Sorting output from PIPE REXXVARS TOLOAD for dumping a stem variable

2008-05-06 Thread Fred Schmidt
On Mon, 05 May 2008 22:54:23 -0700, Rob van der Heij wrote:
What you do is you add an extra field to the record to sort them on,
and then drop that extra field again. Like this:
spec ws = fs . substr f2 of w1 1.10 r 1-* n | sort 1.10 | substr 11-*

Thanks Rob,

Is SUBSTR something I need to get from somewhere else? 

FPLSCB027E Entry point SUBSTR not found  
FPLSCA003I ... Issued from stage 12 of pipeline 1  
FPLSCA001I ... Running SUBSTR 11-*  
   148 *-*'PIPE REXXVARS' ,  
'|BUFFER' ,/* Get all input records 
now  */
'|DROP 1' ,/* Discard first line   */
'|CHANGE 1.2 /v /=/'  ,/*   */
'|JOIN 1' ,/* Combine varname with 
value */
'|LOCATE 1.2 /n /',/* Only lines with 
var=value  */
'|CHANGE 1.2 /n //'   ,/*   */
'|CASEI LOCATE /'varname'/'   ,/* Only lines with our 
varname*/
'|CASEI NLOCATE /VARNAME=/'   ,/* But not with this string 
  */
'|SPEC WS = FS . SUBSTR F2 OF W1 1.10 R 1-* N' ,  
'|SORT 1.10'   ,  
'|SUBSTR 11-*' ,  
'|CONSOLE' /* Output to the terminal  
*/
   +++ RC(-27) +++  

Regards,
Fred Schmidt
Department of Corporate and Information Services (DCIS)
Data Centre Services (DCS)
Northern Territory Government, Australia


Re: Sorting output from PIPE REXXVARS TOLOAD for dumping a stem variable

2008-05-06 Thread Rob van der Heij
On Tue, May 6, 2008 at 8:52 AM, Fred Schmidt [EMAIL PROTECTED] wrote:

 Ah, I got it to work by changing...

 spec ws = fs . substr f2 of w1 1.10 r 1-* n | sort 1.10 | substr 11-*

Right. The substr stage is fairly new. It's a bit cheaper than a
full spec stage. A popular alternative in this case would be not
chop 10 to remove the first 10 byte.

 Rob