Insert Data in a particular record



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Insert Data in a particular record

Postby samurai007 » Mon Jul 20, 2009 10:53 pm

Hi,

I have a PS file of LRECL=80, RECFM=FB and BLKSIZE=8000.
It looks like this :

******* ********************************************************
00100 .......................Data............................
00200 .......................Data............................
00300 .......................Data............................
00400 Number of records is :
00500 .......................Data............................
00600 .......................Data............................
******* ********************************************************


I need to insert the record count at the end of the 4th line. This record count is in another PS file, with the same LRECL, BLKSIZE and RECFM as above.


******* *****************************
00100 0000011425
******* *****************************


So, the final output file should like something like :

******* ********************************************************
00100 .......................Data............................
00200 .......................Data............................
00300 .......................Data............................
00400 Number of records is : 0000011425
00500 .......................Data............................
00600 .......................Data............................
******* ********************************************************

Any idea how this can be done using a JCL ???
samurai007
 
Posts: 22
Joined: Mon Jul 20, 2009 10:42 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Insert Data in a particular record

 

Re: Insert Data in a particular record

Postby Frank Yaeger » Mon Jul 20, 2009 11:22 pm

Here's a DFSORT job that will do what I think you asked for:

//S1    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
0000011425
/*
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN    DD    *
  OPTION COPY
  INREC BUILD=(C'CT,''',1,10,C'''',80:X)
/*
//S2    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SORTIN DD *
.......................Data............................
.......................Data............................
.......................Data............................
Number of records is :
.......................Data............................
.......................Data............................
/*
//SORTOUT DD SYSOUT=*
//SYSIN    DD    *
  OPTION COPY
  INREC IFTHEN=(WHEN=(1,9,CH,EQ,C'Number of'),
    OVERLAY=(24:CT))
/*
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1080
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 14 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post