Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Need help with this dfsort problem

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
kushkush

New User


Joined: 30 Jun 2005
Posts: 27
Location: Germany

PostPosted: Sun Feb 02, 2020 6:34 pm    Post subject: Need help with this dfsort problem
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: 308
Location: Inside the SPEW (Cincinnati OH USA)

PostPosted: Sun Feb 02, 2020 9:54 pm    Post subject:
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: 156
Location: Germany

PostPosted: Mon Feb 03, 2020 3:08 am    Post subject:
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: 716
Location: Maryland

PostPosted: Mon Feb 03, 2020 9:10 pm    Post subject:
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: 156
Location: Germany

PostPosted: Mon Feb 03, 2020 11:28 pm    Post subject:
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: 27
Location: Germany

PostPosted: Tue Feb 04, 2020 12:42 am    Post subject:
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: 156
Location: Germany

PostPosted: Tue Feb 04, 2020 12:45 am    Post subject:
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: 716
Location: Maryland

PostPosted: Tue Feb 04, 2020 7:46 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts TSO IOF problem josephineyeow TSO/ISPF 5 Fri Mar 27, 2020 10:18 pm
No new posts DFSORT Output file order query A_programmers DFSORT/ICETOOL 1 Thu Mar 26, 2020 11:59 pm
This topic is locked: you cannot edit posts or make replies. DFSORT-How to convert ZD to ZS in DFSORT useit DFSORT/ICETOOL 2 Thu Mar 26, 2020 10:43 am
No new posts DFSORT to handle in between specific ... subratarec DFSORT/ICETOOL 6 Thu Feb 06, 2020 1:22 am
No new posts RegEx Support in DFSORT (z/OS 2.4) Joerg.Findeisen DFSORT/ICETOOL 3 Thu Nov 14, 2019 7:44 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us