Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to write the next record conditionaly

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

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Sun Apr 13, 2008 7:47 am    Post subject: How to write the next record conditionaly
Reply with quote

Hi Frank,

I have a similar request to the one in:

http://ibmmainframes.com//viewtopic.php?t=29749

ie. when a condition is met the record is written out and the next immediate record is also written out if the first byte is an S


Code:
N 4000000 LPAR     08102 13:39:03.16 JOB05823 00000094                 
N 0000000 LPAR     08102 13:39:03.41 JOB05935 00000281                 
N 0000000 LPAR     08102 13:39:04.89  JOB05935 00000281                 
S                                                       NS1           U-
N 0000000 LPAR     08102 13:39:05.22   JOB05935 00000281               
N 4000000 LPAR     08102 13:39:05.46 JOB05979 00000094                 
N 4000000 LPAR     08102 13:39:05.48 JOB05979 00000094                 
N 0000000 LPAR     08102 13:39:06.36       JOB05935 00000281           
N 0000000 LPAR     08102 13:39:07.21 JOB05935 00000281                 
S                                                       NS2           U-
N 4000000 LPAR     08102 13:39:07.68 JOB05979 00000094                 
N 4000000 LPAR     08102 13:39:07.69 JOB05979 00000094                 
S                                                                       
N 0200000 LPAR     08102 13:39:08.00 JOB06024 00000285                 
S                                                                       


In the data I have provided, whenever string JOB05935 is found it needs to be written out as well as the next record if it has an S in col1.

The result should be :-
Code:
N 0000000 LPAR     08102 13:39:03.41 JOB05935 00000281                 
N 0000000 LPAR     08102 13:39:04.89  JOB05935 00000281                 
S                                                       NS1           U-
N 0000000 LPAR     08102 13:39:05.22   JOB05935 00000281               
N 0000000 LPAR     08102 13:39:06.36       JOB05935 00000281           
N 0000000 LPAR     08102 13:39:07.21 JOB05935 00000281                 
S                                                       NS2           U-


The position of string JOB05935 is unknown.

Gerry
Back to top
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Mon Apr 14, 2008 10:23 pm    Post subject:
Reply with quote

Here's a DFSORT/ICETOOL job that will do what you asked for:

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN DD DSN=...  input file (FB/80)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT DD DSN=...  output file (FB/80)
//TOOLIN   DD    *
COPY FROM(IN) TO(T1) USING(CTL1)
SPLICE FROM(T1) TO(OUT) ON(81,8,ZD) KEEPBASE KEEPNODUPS -
  WITHALL WITH(1,96) USING(CTL3)
/*
//CTL1CNTL DD *
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,8,ZD)),
        IFTHEN=(WHEN=(1,80,SS,EQ,C'JOB05935'),
                OVERLAY=(81:SEQNUM,8,ZD,97:C'Y')),
        IFTHEN=(WHEN=NONE,
                OVERLAY=(89:SEQNUM,8,ZD,
                         81:81,8,ZD,SUB,89,8,ZD,TO=ZD,LENGTH=8))
  OUTREC OVERLAY=(89:SEQNUM,8,ZD,RESTART=(81,8))
/*
//CTL3CNTL DD *
  OUTFIL FNAMES=OUT,
   INCLUDE=((89,8,ZD,EQ,+1,AND,97,1,CH,EQ,C'Y'),OR,
    (89,8,ZD,EQ,+2,AND,97,1,CH,EQ,C'Y',AND,1,1,CH,EQ,C'S')),
   BUILD=(1,80)
/*
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Tue Apr 15, 2008 6:16 am    Post subject:
Reply with quote

Hi Frank,
it works like a charm, very handy when extracting information from the SYSLOG.

Thanks

Gerry
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 Record Not found in AlX but record re... mukun264 COBOL Programming 7 Fri Mar 24, 2017 9:28 am
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts Write R1 and R2 to OP1 and R1 to OP2 bhaskar_kanteti DFSORT/ICETOOL 10 Fri Mar 03, 2017 11:18 am
No new posts Can you write 2 recs on SORTOUT when ... Sysaron DFSORT/ICETOOL 6 Thu Feb 23, 2017 12:07 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us