Been tearing my hair out with this one, so hoping somebody can shed light on it?
I have variable records (VB/4096/27998) with the following format:
Code:
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2----+-
0200 $ 2015-11-10 #GROUP NO NO NO NO NO 200 GENERIC USER ID #GROUP 10:18:23 2015-11-10
0200 irrcerta 1999-10-20 irrcerta NO NO NO YES NO 000 CERTAUTH Anchor 2015-11-11
0200 irrmulti 2000-12-02 irrmulti NO NO NO YES NO 000 Criteria Anchor
0200 irrsitec 1999-10-20 irrsitec NO NO NO YES NO 000 SITE Anchor
0200 BPXOINIT 2002-11-13 IBMUSER NO NO NO NO NO 180 BPXOINIT SYS1
I want to extract columns 6-13 (8), 26-33 (8), 75-94 (20), 114-123 (10) and 105-112 (8) into a CSV file, separated by commas.
example:
Code:
$ ,#GROUP ,GENERIC USER ID ,2015-11-10,10:18:23
irrcerta,irrcerta,CERTAUTH Anchor ,2015-11-11,
or better still
Code:
$,#GROUP,GENERIC USER ID,2015-11-10,10:18:23
irrcerta,irrcerta,CERTAUTH Anchor,2015-11-11
I've tried all manner combinations of of INREC, PARSE, OUTREC, OUTFIL but always fall foul of various ICE messages which don't appear to help me much.
Has anybody done a similar thing, and if so could you please furnish me with an example?
Many thanks in advance.
Joined: 15 Aug 2015 Posts: 1337 Location: Bamberg, Germany
Use a semicolon as separator field, not the comma. See snippet as below that should work with the IRRDBU extract dataset, and comes close to your requirement.
Code:
OPTION COPY
INREC IFTHEN=(WHEN=INIT,
BUILD=(1,4,10,8,X,30,8,X,79,20,X,117,11,X,108,9)),
IFTHEN=(WHEN=INIT,
BUILD=(1,4,5,60,SQZ=(SHIFT=LEFT,MID=C';',LENGTH=60)))
END
Joerg,
OK, gives me further results to what I had before (at least RC=0 instead of 16!)
But I need to adjust a little more for what I'm looking to do.
Many thanks, pal!
Joerg,
Almost there, thanks, but a couple of minor problems -
(1) The third field (75-94 (20)) contians spaces, and these get translated to semi-colons (";") instead of being preserved?
(2) Intermediate fields without values do NOT get translated to a defualt ";"
Use a semicolon as separator field, not the comma. See snippet as below that should work with the IRRDBU extract dataset, and comes close to your requirement.
Code:
OPTION COPY
INREC IFTHEN=(WHEN=INIT,
BUILD=(1,4,10,8,X,30,8,X,79,20,X,117,11,X,108,9)),
IFTHEN=(WHEN=INIT,
BUILD=(1,4,5,60,SQZ=(SHIFT=LEFT,MID=C';',LENGTH=60)))
END
Been tearing my hair out with this one, so hoping somebody can shed light on it?
I have variable records (VB/4096/27998) with the following format:
Code:
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2----+-
0200 $ 2015-11-10 #GROUP NO NO NO NO NO 200 GENERIC USER ID #GROUP 10:18:23 2015-11-10
0200 irrcerta 1999-10-20 irrcerta NO NO NO YES NO 000 CERTAUTH Anchor 2015-11-11
0200 irrmulti 2000-12-02 irrmulti NO NO NO YES NO 000 Criteria Anchor
0200 irrsitec 1999-10-20 irrsitec NO NO NO YES NO 000 SITE Anchor
0200 BPXOINIT 2002-11-13 IBMUSER NO NO NO NO NO 180 BPXOINIT SYS1
I want to extract columns 6-13 (8), 26-33 (8), 75-94 (20), 114-123 (10) and 105-112 (8) into a CSV file, separated by commas.
example:
Code:
$ ,#GROUP ,GENERIC USER ID ,2015-11-10,10:18:23
irrcerta,irrcerta,CERTAUTH Anchor ,2015-11-11,
or better still
Code:
$,#GROUP,GENERIC USER ID,2015-11-10,10:18:23
irrcerta,irrcerta,CERTAUTH Anchor,2015-11-11
I've tried all manner combinations of of INREC, PARSE, OUTREC, OUTFIL but always fall foul of various ICE messages which don't appear to help me much.
Has anybody done a similar thing, and if so could you please furnish me with an example?
Many thanks in advance.