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

Want to split the record in two output file


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

Active User


Joined: 26 Feb 2007
Posts: 126
Location: Chennai

PostPosted: Tue Jun 05, 2007 7:33 pm
Reply with quote

Hi Frank,
I need a JCl using ICETOOL for the below requirements.

I/P file - LRECL=133,RECFM=FB
--------------------------------------
Code:
A1 Filename Comparision1>>>>>>>>>>>>>>>>>>>>>>> Filename
F1 E1 REF-PPL-SUFFIX-ID DI I 0321 B 5 00918470
V3 E2 INF3-REF-DSCNT-AMT DI I 0327 B 5 00918470
V1 E2 PPL-RPT-DESC-TX CH I 0343 B 5 00918470
  ************TABLE REORG - RECORD DELETION STARTS**********
F1 E3 C 01355937 903559239000000013000000000000000+0
  ************TABLE REORG - RECORD DELETION ENDS**********
  ************TABLE REORG - RECORD DELETION STARTS**********
F1 E3 R 01355937 903559239000000013000000000000000+0
  ************TABLE REORG - RECORD DELETION ENDS**********
A2 Filename Comparision1>>>>>>>>>>>>>>>>>>>>>>> Filename
V4 E2 REF-PPL-SUFFIX-ID DI I 0321 B 5 00918470
V4 E2 INF3-REF-DSCNT-AMT DI I 0327 B 5 00918470
F1 E1 PPL-RPT-DESC-TX CH I 0343 B 5 00918470
  ************TABLE REORG - RECORD DELETION STARTS**********
F1 E1 C 01355937 903559239000000013000000000000000+0
  ************TABLE REORG - RECORD DELETION ENDS**********


I want to split the record,
which exists in between
************TABLE REORG - RECORD DELETION STARTS**********
************TABLE REORG - RECORD DELETION ENDS**********
has to be moved in output file1
and the remaining record has to moved in outputfile2.

O/P file1
---------
Code:
F1 E3 C 01355937 903559239000000013000000000000000+0
F1 E3 R 01355937 903559239000000013000000000000000+0
F1 E1 C 01355937 903559239000000013000000000000000+0

O/p file-2
---------
Code:
A1 Filename Comparision1>>>>>>>>>>>>>>>>>>>>>>> Filename
F1 E1 REF-PPL-SUFFIX-ID       DI I 0321 B 5 00918470
V3 E2 INF3-REF-DSCNT-AMT      DI I 0327 B 5 00918470
V1 E2 PPL-RPT-DESC-TX         CH I 0343 B 5 00918470
A2 Filename Comparision1>>>>>>>>>>>>>>>>>>>>>>> Filename
V4 E2 REF-PPL-SUFFIX-ID       DI I 0321 B 5 00918470
V4 E2 INF3-REF-DSCNT-AMT      DI I 0327 B 5 00918470
F1 E1 PPL-RPT-DESC-TX         CH I 0343 B 5 00918470

Thanks
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Tue Jun 05, 2007 9:11 pm
Reply with quote

Here's a DFSORT/ICETOOL job that will do what you asked for. You'll need z/OS DFSORT V1R5 PTF UK90007 or DFSORT R14 PTF UK90006 (April, 2006) in order to use INREC with SPLICE. If you don't have the April, 2006 PTF, you won't get any output. Ask your System Programmer to install the PTF (it's free). Alternatively, you could use a separate COPY operator with INREC and the SPLICE operator without INREC.

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN DD DSN=...  input file (FB/133)
//OUT1 DD DSN=...  output file1 (FB/133)
//OUT2 DD DSN=...  output file2 (FB/133)
//TOOLIN   DD    *
SPLICE FROM(IN) TO(OUT1) ON(135,8,ZD) KEEPBASE KEEPNODUPS -
  WITHALL WITH(1,133) USING(CTL1)
/*
//CTL1CNTL DD *
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(134:X,135:SEQNUM,8,ZD)),
        IFTHEN=(WHEN=(3,3,CH,EQ,C'***',AND,
                      45,4,SS,EQ,C'STAR,ENDS'),
                OVERLAY=(135:SEQNUM,8,ZD),HIT=NEXT),
        IFTHEN=(WHEN=(3,3,CH,EQ,C'***',AND,
                      45,4,CH,EQ,C'STAR'),
                OVERLAY=(134:C'A')),
        IFTHEN=(WHEN=NONE,
                OVERLAY=(143:SEQNUM,8,ZD,
                         135:135,8,ZD,SUB,143,8,ZD,M11,LENGTH=8))
  OUTFIL FNAMES=OUT1,
    INCLUDE=(134,1,CH,EQ,C'A',AND,3,3,CH,NE,C'***'),
    BUILD=(1,133)
  OUTFIL FNAMES=OUT2,
    INCLUDE=(134,1,CH,EQ,C' ',AND,3,3,CH,NE,C'***'),
    BUILD=(1,133)
/*
Back to top
View user's profile Send private message
ibmmainframesyntel

Active User


Joined: 26 Feb 2007
Posts: 126
Location: Chennai

PostPosted: Tue Jun 05, 2007 11:21 pm
Reply with quote

Hi Frank,
i understood every thing except the below things.
could u explain it.

1) 45,4,SS,EQ,C'STAR,ENDS'),
OVERLAY=(135:SEQNUM,8,ZD),HIT=NEXT)

what is 'SS' and HIT=NEXT?
could u explain it.

Thanks
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Tue Jun 05, 2007 11:43 pm
Reply with quote

SS is substring search - see the following for an explanation:

publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CG20/2.2.6?DT=20060615173822

HIT=NEXT tells DFSORT to continue with the next IFTHEN clause even if this IFTHEN clause is satisfied. That way, we will also test the next IFTHEN clause for 'STAR'. Without HIT=NEXT, we wouldn't get to that next IFTHEN clause for 'STAR'.

If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

Use [URL] BBCode for External Links
Back to top
View user's profile Send private message
ibmmainframesyntel

Active User


Joined: 26 Feb 2007
Posts: 126
Location: Chennai

PostPosted: Sat Jun 09, 2007 4:22 pm
Reply with quote

Hi Frank,
i got it.
Thanks.
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 Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top