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
 

 

Want to split the record in two output file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Want to split the record in two output file
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 Moderator


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

PostPosted: Tue Jun 05, 2007 9:11 pm    Post subject:
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    Post subject: Re: Want to split the record in two output file
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 Moderator


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

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

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

http://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:

www.ibm.com/servers/storage/support/software/sort/mvs/srtmpub.html
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    Post subject: Re: Want to split the record in two output file
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    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 SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Incorrect output when trying to add n... monica1 PL/I & Assembler 10 Fri Jan 13, 2017 5:02 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm


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