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

Record splicing using ICETOOL


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

New User


Joined: 23 Dec 2005
Posts: 61
Location: Providence , US

PostPosted: Thu Aug 31, 2006 7:40 pm
Reply with quote

Hi All,

I have a problem where I have a input file of below given format :

Code:

ABC1152252014   001  00000011111   0000027773 
            15.00       100                       
ABC1241779001   001  00000022211   0000023964 
            15.00       200                     
ABC1241779001   001  00000033311   0000000233 
            15.00       300                       
ABC1241779001   001  00000044411   0000021005 
            15.00       400                       
ABC1252241001   001  00000055511   6010017043 
            31.19       500                       
ABC3216090243   001  00000066611   0000000000 
           118.73      600                       


I have to create a new file which is of the format :

Code:

ABC1152252014   001  00000011111   0000027773  15.00  100
ABC1241779001   001  00000022211   0000023964  15.00  200
ABC1241779001   001  00000033311   0000000233  15.00  300
ABC1241779001   001  00000044411   0000021005  15.00  400
ABC1252241001   001  00000055511   6010017043  31.19  500


Actually the 2nd row needs to be spliced into a new file .
How can i do the same using ICETOOL.
The input file is of FBA record format and record length is 133 .

Regards,
Vishal
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: Thu Aug 31, 2006 9:42 pm
Reply with quote

Since your input file has RECFM=FBA, I'll assume the data you show actually starts in position 2 after the ANSI carriage control character. I'll also assume that we can identify the first record of each pair by the fact that it starts with nonblanks and the second record of each pair by the fact that it starts with blanks. Given that, 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 have DFSORT, but you don't have the April, 2006 PTF, ask your System Programmer to install it (it's free). For complete details on all of the new DFSORT and ICETOOL functions available with the April, 2006 PTF, see:

Use [URL] BBCode for External Links

Alternatively, you could use a COPY operator and a SPLICE operator instead of just a SPLICE operator.

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG   DD  SYSOUT=*
//IN DD DSN=...  input file (FBA/133)
//OUT DD DSN=...  output file (FBA/133)
//TOOLIN   DD    *
SPLICE FROM(IN) TO(OUT) ON(134,8,ZD) -
  WITH(49,15) USING(CTL1)
/*
//CTL1CNTL DD *
  INREC IFTHEN=(WHEN=(2,5,CH,NE,C' '),
          OVERLAY=(134:SEQNUM,8,ZD)),
        IFTHEN=(WHEN=NONE,
          OVERLAY=(49:14,15,134:SEQNUM,8,ZD))
  OUTFIL FNAMES=OUT,BUILD=(1,133)
/*
Back to top
View user's profile Send private message
saithvis2

New User


Joined: 23 Dec 2005
Posts: 61
Location: Providence , US

PostPosted: Fri Sep 01, 2006 2:50 pm
Reply with quote

Hi Frank,

Thanks yet again for helping me out to solve one of the queries. Actually , I wanted my data in the first line to remain the same and the o/p file should have data of the first and second line both without any data deletion . (This I should have mentioned in my requirements , as my example was having spaces at the right side which created confusion. My appologies... )

I modified the job to do the same.
The first line was starting from 3rd byte .
The second line was starting from 15th byte.

Code:

 //S1 EXEC PGM=ICETOOL                                       
 //TOOLMSG DD  SYSOUT=*                                       
 //DFSMSG  DD  SYSOUT=*                                       
 //IN      DD  DISP=SHR,DSN=ABC.VZS.ERROR.APR06.INT1         
 //T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(35,5)),DISP=(,PASS) 
 //OUT     DD  DSN=ABC.VZS.ERROR.APR06.INT2,                 
 //             SPACE=(CYL,(30,2),RLSE),                     
 //             DCB=(RECFM=FB,LRECL=179),                     
 //             DISP=(NEW,CATLG,DELETE)                       
 //*                                                         
 //TOOLIN DD *                                               
 COPY FROM(IN) TO(T1) USING(CTL1)                             
 SPLICE FROM(T1) TO(OUT) ON(180,8,ZD) -                       
   WITH(134,46) USING(CTL2)                                   
 /*                                                           
 //CTL1CNTL DD *                                             
   SORT FIELDS=COPY                                           
   OUTFIL OUTREC=(1:1,133,46X)                               
 /*                                                           
 //CTL2CNTL DD *                                             
  INREC IFTHEN=(WHEN=(3,5,CH,NE,C' '),           
            OVERLAY=(180:SEQNUM,8,ZD)),           
          IFTHEN=(WHEN=NONE,                     
            OVERLAY=(134:15,46,180:SEQNUM,8,ZD)) 
    OUTFIL FNAMES=OUT,BUILD=(1,179)               
/*                                               


With each post of your's I am becoming a great fan of DFSORT and DFSORT's ICETOOL.
Thanks again , have a great day and weekend.

regards,
Vishal
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 How to split large record length file... DFSORT/ICETOOL 7
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Validating record count of a file is ... DFSORT/ICETOOL 13
Search our Forums:

Back to Top