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
 

 

Record splicing using ICETOOL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Record splicing using ICETOOL
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 Moderator


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

PostPosted: Thu Aug 31, 2006 9:42 pm    Post subject:
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:

www.ibm.com/servers/storage/support/software/sort/mvs/peug/

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    Post subject: Re: Record splicing using ICETOOL
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    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 4 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 To Merge mutliple records into a sing... anandgbe DFSORT/ICETOOL 6 Wed Feb 22, 2017 8:49 am
No new posts Converting decimal to numeric using I... Balaryan DFSORT/ICETOOL 4 Thu Feb 02, 2017 11:27 pm


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