Never mind, came up with an additional level of abstraction/indirection
that works as desired:
'|Spec a: w4 . b: w6 . Set (#0:=a;#1:=b) read',
'a: w1 . set #2:=8-Length(a)',
'while #0<=#1 Do',
'set #3:=string(Right(#0,#2,"0"))',
'w1 n print #3 n w2 nw w1 nw',
'print #3 n w4-* nw',
'if #0<#1 then write fi',
'set #0+=1 done',
In short:
inp.1 = 'abc pool low 1 high 4 include abcdef'
inp.2 = 'abc identity abc autoonly G'
inp.3 = 'de pool low 3 high 6 include some1'
inp.4 = 'de user de lbyonly eg'
inp.5 = 'x pool low 16 high 23 include george'
inp.6 = 'x identity x cantbe a valid password'
inp.0 = 6
'PIPE Stem inp.',
'|Spec a: w4 . b: w6 . Set (#0:=a;#1:=b) read',
'a: w1 . set #2:=8-Length(a)',
'while #0<=#1 Do',
'set #3:=string(Right(#0,#2,"0"))',
'w1 n print #3 n w2 nw w1 nw',
'print #3 n w4-* nw',
'if #0<#1 then write fi',
'set #0+=1 done',
'|Cons'
produces:
abc00001 identity abc00001 G
abc00002 identity abc00002 G
abc00003 identity abc00003 G
abc00004 identity abc00004 G
de000003 user de000003 lbyonly eg
de000004 user de000004 lbyonly eg
de000005 user de000005 lbyonly eg
de000006 user de000006 lbyonly eg
x0000016 identity x0000016 cantbe a valid password
x0000017 identity x0000017 cantbe a valid password
x0000018 identity x0000018 cantbe a valid password
x0000019 identity x0000019 cantbe a valid password
x0000020 identity x0000020 cantbe a valid password
x0000021 identity x0000021 cantbe a valid password
x0000022 identity x0000022 cantbe a valid password
x0000023 identity x0000023 cantbe a valid password
--
Mike Harding
z/VM System Support
/sp
CMSTSO Pipelines Discussion List <[email protected]> wrote on
07/22/2013 03:48:12 PM:
> From: Michael Harding/Oakland/IBM@IBMUS
> To: [email protected],
> Date: 07/22/2013 03:50 PM
> Subject: Trick needed
> Sent by: CMSTSO Pipelines Discussion List <[email protected]>
>
> How do you specify the size of an output object in specs at run time?
>
> I want to expand directory POOL statements myself. I have:
>
> '|gpa:Lookup w1 master detail', /* pull in any POOL records */
> '|Spec a: w4 . b: w6 . Set (#0:=a;#1:=b) read', /* userid POOL LOW x
HIGH
> y ... */
> 'a: w1 . set #2:=8-Length(a)',
> 'while #0<=#1 Do',
> 'w1 n print #0 n.(#2) right w2 nw w1 nw',
> 'print #0 n.(#2) right w4-* nw',
> 'if #0<#1 then write fi',
> 'set #0+=1 done',
>
> The intent is to take the userid from the USER or IDENTITY statement and
> produce as many USER or IDENTITY statements with the userid expanded it
to
> UUUnnnnn, UUnnnnnn or Unnnnnnn as specified by the POOL statement.
> The input to this has the USER/IDENTITY statement on the primary input to
> the lookup, the POOL statement on the secondary. All statements have a
> 9-character prefix with the userid.
> The ultimate purpose is to end up with a file to match against a RACF LU
*
> to pick out userids without RACF profiles, and profiles that aren't in
the
> directory.
>
> I thought I'd seen, though of course can't remember or find where, the
> n.(#2) construct for output placement.
> It also doesn't work without the parens.
> Any thoughts?
> Tia,
> --
> Mike Harding
> z/VM System Support
>
> /sp