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

Include current & next records if strings found accordingly


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

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Sat Jan 04, 2020 5:19 pm
Reply with quote

You will note that, now that I have corrected the coding in the original post, that ALL records pertaining to a particular user are to be selected even if not followed by '---' records. Judging by the comments from OP this is an extract from a larger report of all records pertaining to a user.

Quote:
In my opinion it makes more sense to talk to the guys who produce such crappy input.

Probably have to talk to CA or IBM then as it is probably a security audit report.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Mon Jan 06, 2020 6:44 pm
Reply with quote

For JPn statements see the section in chapter 8 "Using SET and PROC..."
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2018
Location: USA

PostPosted: Mon Jan 06, 2020 8:09 pm
Reply with quote

Code:
//SORTGRP EXEC PGM=ICETOOL                                             
//*                                                                   
//TOOLMSG  DD  SYSOUT=*                                               
//DFSMSG   DD  SYSOUT=*                                               
//REPORT   DD  SYSOUT=*                                               
//*                                                                   
//SORTIN   DD  *                                                       
DELETE USER008 AAAAAAAAA                                               
DELETE USER001 BBBBBBBBB                                               
DELETE USER007 CCCCCCCC                                               
DEFINE USER001 DDDDDDDD                                               
- GARBAGE GARBAGE GARBAGE                                             
---NAME JOHN                                                           
- GARBAGE GARBAGE GARBAGE                                             
---DEPT ABC                                                           
EEEEEEEEEEEEEEEEEEEEEEEEE                                             
- GARBAGE GARBAGE GARBAGE                                             
LIST USER111                                                           
---TO BE OR NOT TO BE?                                                 
LIST USER001                                                           
---ALL                                                                 
DELETE USER009 FFFFFFFFFFFF                                           
//*                                                                   
//*--------------------------------------------------------------------
//TOOLIN   DD  *                                                       
  COPY FROM(SORTIN) TO(LIST)        USING(S001)                       
  COPY JKFROM       TO(SORTOUT)     USING(S002)                       
//*                                                                   
//*--------------------------------------------------------------------
//S001CNTL DD  *                                                       
 INREC IFTHEN=(WHEN=(1,8,SS,EQ,L(C'DELETE ',C'DEFINE ',C'LIST ')),     
               PARSE=(%=(ENDBEFR=BLANKS),                             
                      %1=(STARTAT=NONBLANK,                           
                          ENDBEFR=BLANKS,                             
                          FIXLEN=9)),                                 
               BUILD=(%1,5X,1,80)),                                   
       IFTHEN=(WHEN=NONE,                                             
               BUILD=(9X,5X,1,80))                                     
*                                                                     
 SORT FIELDS=COPY                                                     
*                                                                     
 OUTREC IFTHEN=(WHEN=GROUP,                                           
                BEGIN=(1,8,CH,NE,C' '),                               
                PUSH=(1:1,8,                                           
                     10:ID=2,SEQ=2))                                   
*                                                                     
 OUTFIL FNAMES=(FULL,FULL@),                                           
        INCLUDE=(1,8,CH,EQ,C'USER001',                                 
             AND,(14,15,SS,EQ,C' ---',                                 
               OR,12,2,ZD,EQ,+1))                                     
*                                                                     
 OUTFIL FNAMES=(SELECT,SELECT@),                                       
        INCLUDE=(1,8,CH,EQ,C'USER001',                                 
             AND,14,15,SS,EQ,C' ---'),                                 
        REMOVECC,NODETAIL,                                             
        SECTIONS=(1,11,                                               
                  TRAILER3=(1,13))                                     
*                                                                     
//*                                                                   
//*--------------------------------------------------------------------
//S002CNTL DD  *                                                       
 JOINKEYS F1=FULL,                                                     
          FIELDS=(1,11,A)                                             
 JOINKEYS F2=SELECT,                                                   
          FIELDS=(1,11,A)                                             
 REFORMAT FIELDS=(F1:15,80)                                           
//*                                                                   
//*--------------------------------------------------------------------
//LIST     DD  SYSOUT=*                                               
//FULL@    DD  SYSOUT=*                                               
//FULL     DD  DISP=(NEW,PASS),                                       
//             UNIT=SYSDA,SPACE=(TRK,(5,5)),                           
//             DSN=&&FULL                                             
//SELECT@  DD  SYSOUT=*                                               
//SELECT   DD  DISP=(NEW,PASS),                                       
//             UNIT=SYSDA,SPACE=(TRK,(5,5)),                           
//             DSN=&&SELECT                                           
//*                                                                   
//SORTOUT  DD  SYSOUT=*             
//*                               

Code:
********************************* TOP OF DATA ********
DEFINE USER001 DDDDDDDD                               
---NAME JOHN                                         
---DEPT ABC                                           
LIST USER001                                         
---ALL                                               
******************************** BOTTOM OF DATA ******
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 INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts How I Found a Bug in a FORTRAN Compiler All Other Mainframe Topics 4
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts To get the the current time DFSORT/ICETOOL 13
Search our Forums:

Back to Top