IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Need help with this dfsort problem


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
kushkush

New User


Joined: 30 Jun 2005
Posts: 36
Location: Germany

PostPosted: Sun Feb 02, 2020 6:34 pm
Reply with quote

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
View user's profile Send private message
dneufarth

Active User


Joined: 27 Apr 2005
Posts: 319
Location: Inside the SPEW (Cincinnati OH USA)

PostPosted: Sun Feb 02, 2020 9:54 pm
Reply with quote

Why not just INCLUDE

"++ REASON" or "++++"
Back to top
View user's profile Send private message
Joerg.Findeisen

Active User


Joined: 15 Aug 2015
Posts: 388
Location: Bamberg, Germany

PostPosted: Mon Feb 03, 2020 3:08 am
Reply with quote

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
View user's profile Send private message
sergeyken

Active Member


Joined: 29 Apr 2008
Posts: 930
Location: Maryland

PostPosted: Mon Feb 03, 2020 9:10 pm
Reply with quote

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
View user's profile Send private message
Joerg.Findeisen

Active User


Joined: 15 Aug 2015
Posts: 388
Location: Bamberg, Germany

PostPosted: Mon Feb 03, 2020 11:28 pm
Reply with quote

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
View user's profile Send private message
kushkush

New User


Joined: 30 Jun 2005
Posts: 36
Location: Germany

PostPosted: Tue Feb 04, 2020 12:42 am
Reply with quote

Thank you Dneufarth and Joerg
It is working as you have suggested

Kushjush
Back to top
View user's profile Send private message
Joerg.Findeisen

Active User


Joined: 15 Aug 2015
Posts: 388
Location: Bamberg, Germany

PostPosted: Tue Feb 04, 2020 12:45 am
Reply with quote

Guess it is part of IBM Kassandra Service and you are parsing ACTIONS out of it. Enjoy icon_smile.gif
Back to top
View user's profile Send private message
sergeyken

Active Member


Joined: 29 Apr 2008
Posts: 930
Location: Maryland

PostPosted: Tue Feb 04, 2020 7:46 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Sysncsort - Justification problem SYNCSORT 6
No new posts Join lines with dfsort DFSORT/ICETOOL 5
No new posts Problem getting record length of a re... COBOL Programming 2
No new posts Problem while trying to manipulate re... DFSORT/ICETOOL 3
No new posts Covert k to 1000 / m to 1000000 using... DFSORT/ICETOOL 5
Search our Forums:

Back to Top