|
View previous topic :: View next topic
|
| Author |
Message |
kushkush
New User
Joined: 30 Jun 2005 Posts: 37 Location: Germany
|
|
|
|
| Code: |
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTOUT DD SYSOUT=*
//SORTIN DD *
++ REASON(ACTION)
22222BBBB
33333CCCC
44444DDDD
++
55555EEEE
++ REASON(ACTION)
Y3333CCCC
Z4444DDDD
++++
77777BBBB
88888FFFF
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OUTREC IFTHEN=(WHEN=GROUP,BEGIN=(11,6,CH,EQ,C'ACTION'),
END=(1,2,CH,EQ,C'++'),PUSH=(31:ID=1))
OUTFIL INCLUDE=(31,1,CH,NE,C' '),BUILD=(1,30)
|
Result:
++ REASON(ACTION)
++ REASON(ACTION)
It is not picking up the end string as it is with '++'
What am i doing wrong?
We are at z/OS 2.2 |
|
| Back to top |
|
 |
dneufarth
Active User

Joined: 27 Apr 2005 Posts: 420 Location: Inside the SPEW (Southwest Ohio, USA)
|
|
|
|
Why not just INCLUDE
"++ REASON" or "++++" |
|
| Back to top |
|
 |
Joerg.Findeisen
Senior Member

Joined: 15 Aug 2015 Posts: 1430 Location: Bamberg, Germany
|
|
|
|
| Code: |
OPTION COPY
OUTREC IFTHEN=(WHEN=GROUP,BEGIN=(1,4,CH,EQ,C'++ R'),
END=(1,2,CH,EQ,C'++',AND,1,4,CH,NE,C'++ R'),PUSH=(31:ID=1))
OUTFIL INCLUDE=(31,1,CH,NE,C' '),BUILD=(1,30)
END |
should come up with what's wanted by the OP
| Code: |
++ REASON(ACTION)
22222BBBB
33333CCCC
44444DDDD
++
++ REASON(ACTION)
Y3333CCCC
Z4444DDDD
++++ |
|
|
| Back to top |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2272 Location: USA
|
|
|
|
| Joerg.Findeisen wrote: |
| Code: |
OPTION COPY
OUTREC IFTHEN=(WHEN=GROUP,BEGIN=(1,4,CH,EQ,C'++ R'),
END=(1,2,CH,EQ,C'++',AND,1,4,CH,NE,C'++ R'),PUSH=(31:ID=1))
OUTFIL INCLUDE=(31,1,CH,NE,C' '),BUILD=(1,30)
END |
|
| Code: |
OPTION COPY
OUTREC IFTHEN=(WHEN=GROUP,
BEGIN=(1,4,CH,EQ,C'++ R'),
END=(1,2,CH,EQ,C'++ '),
PUSH=(31:ID=1))
OUTFIL INCLUDE=(31,1,CH,NE,C' '),
BUILD=(1,30)
END |
|
|
| Back to top |
|
 |
Joerg.Findeisen
Senior Member

Joined: 15 Aug 2015 Posts: 1430 Location: Bamberg, Germany
|
|
|
|
| sergeyken wrote: |
| Code: |
OPTION COPY
OUTREC IFTHEN=(WHEN=GROUP,
BEGIN=(1,4,CH,EQ,C'++ R'),
END=(1,2,CH,EQ,C'++ '),
PUSH=(31:ID=1))
OUTFIL INCLUDE=(31,1,CH,NE,C' '),
BUILD=(1,30)
END |
|
| Code: |
++ REASON(ACTION)
++ REASON(ACTION) |
Not exactly what the OP wanted. When you compare a string too long at the same positions as before nothing will change. When the END=() is of fixed length you could code that similar to yours. I assume that was the intention.
| Code: |
OPTION COPY
OUTREC IFTHEN=(WHEN=GROUP,
BEGIN=(1,4,CH,EQ,C'++ R'),
END=(1,30,CH,EQ,C'++'),
PUSH=(31:ID=1))
OUTFIL INCLUDE=(31,1,CH,NE,C' '),
BUILD=(1,30)
END |
|
|
| Back to top |
|
 |
kushkush
New User
Joined: 30 Jun 2005 Posts: 37 Location: Germany
|
|
|
|
Thank you Dneufarth and Joerg
It is working as you have suggested
Kushjush |
|
| Back to top |
|
 |
Joerg.Findeisen
Senior Member

Joined: 15 Aug 2015 Posts: 1430 Location: Bamberg, Germany
|
|
|
|
Guess it is part of IBM Kassandra Service and you are parsing ACTIONS out of it. Enjoy  |
|
| Back to top |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2272 Location: USA
|
|
|
|
| Joerg.Findeisen wrote: |
| sergeyken wrote: |
| Code: |
OPTION COPY
OUTREC IFTHEN=(WHEN=GROUP,
BEGIN=(1,4,CH,EQ,C'++ R'),
END=(1,2,CH,EQ,C'++ '),
PUSH=(31:ID=1))
OUTFIL INCLUDE=(31,1,CH,NE,C' '),
BUILD=(1,30)
END |
|
| Code: |
++ REASON(ACTION)
++ REASON(ACTION) |
Not exactly what the OP wanted. When you compare a string too long at the same positions as before nothing will change. When the END=() is of fixed length you could code that similar to yours. I assume that was the intention.
|
Yes, you are right. Sorry.
Just forgot to increase field length in END= parameter. |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|