Change only first record and opy the rest



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

Change only first record and opy the rest

Postby pucca71 » Thu Nov 11, 2010 12:22 am

Hi again.

This time I have to build a sortcard to read from a file and copy all records to another, but changing just first record, and copy the same equals:
Both files are FB.

From this:
********************************* Top of Data **********************************
//          DD DISP=SHR,DSN=CIPORIN.D10313.T112340.IMAGE                       
//          DD DISP=SHR,DSN=CIPORIN.D10313.T553450.IMAGE                       
//          DD DISP=SHR,DSN=CIPORIN.D10313.T773453.IMAGE                       
******************************** Bottom of Data ********************************

To this:

********************************* Top of Data **********************************
//SORTIN    DD DISP=SHR,DSN=CIPORIN.D10313.T112340.IMAGE                       
//          DD DISP=SHR,DSN=CIPORIN.D10313.T553450.IMAGE                       
//          DD DISP=SHR,DSN=CIPORIN.D10313.T773453.IMAGE                       
******************************** Bottom of Data ********************************


This way I am building a member that will be included in another sort step.

I will appreciatte your help as usual! ;)
Thank you so much.
Pucca.
User avatar
pucca71
 
Posts: 19
Joined: Wed Sep 22, 2010 6:38 am
Has thanked: 0 time
Been thanked: 0 time

Re: Change only first record and opy the rest

 

Re: Change only first record and opy the rest

Postby skolusu » Thu Nov 11, 2010 5:33 am

pucca71,

Use the following DFSORT JCL which will give you the desired results. I assumed that your input is FB recfm and LRECL of 80
//STEP0100 EXEC PGM=SORT                                       
//SYSOUT   DD SYSOUT=*                                         
//SORTIN   DD DATA,DLM=$$                                       
//         DD DISP=SHR,DSN=CIPORIN.D10313.T112340.IMAGE         
//         DD DISP=SHR,DSN=CIPORIN.D10313.T553450.IMAGE         
//         DD DISP=SHR,DSN=CIPORIN.D10313.T773453.IMAGE         
$$                                                             
//SORTOUT  DD SYSOUT=*                                         
//SYSIN    DD *                                                 
  SORT FIELDS=COPY                                             
  INREC IFOUTLEN=80,IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,3,ZD)),
  IFTHEN=(WHEN=(81,3,ZD,EQ,1),OVERLAY=(3:C'SORTIN'))           
//*
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
skolusu
 
Posts: 586
Joined: Wed Apr 02, 2008 10:38 pm
Has thanked: 0 time
Been thanked: 39 times

Re: Change only first record and opy the rest

Postby pucca71 » Thu Nov 11, 2010 5:59 am

Thanks Skolusu !!

I will try your suggested solution and let you know the results.

Thanks again. ;)
Thank you so much.
Pucca.
User avatar
pucca71
 
Posts: 19
Joined: Wed Sep 22, 2010 6:38 am
Has thanked: 0 time
Been thanked: 0 time

Re: Change only first record and copy the rest

Postby pucca71 » Thu Nov 11, 2010 6:07 am

Skosulu ! It worked perfectly !
Thanks a lot.
(BTW, we work for the same company ;) )
Thank you so much.
Pucca.
User avatar
pucca71
 
Posts: 19
Joined: Wed Sep 22, 2010 6:38 am
Has thanked: 0 time
Been thanked: 0 time


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post