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

Date in final file using SYNCSORT


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sunnybunny

New User


Joined: 29 Nov 2005
Posts: 49

PostPosted: Mon Jun 15, 2009 6:40 pm
Reply with quote

Hi,

Can anyone helpme on this please.

I have two input files say A & B.

File A: Date file (with two dates YYYYMMDD format) with length of 16 bytes.
Ex: 2009050120090615

File B: Data file with length of 102 bytes.
Ex: 9991111222222000000000000000000000000000000

My requirement is, I have to generate an output file with following format by using SYNCSORT.

The date 20090615 in first file should be concatenated to second file in last 8 positions as i mentioned in the below format.

9991111222222000000000000000000000020090615

Please provide me the SORT card for this.

Thanks in advance
Sunny.
Back to top
View user's profile Send private message
deepuvja

New User


Joined: 06 Mar 2008
Posts: 5
Location: chennai

PostPosted: Mon Jun 15, 2009 8:27 pm
Reply with quote

I am assuming that
1.There is single record in both files.
2.LRECL of the date file is 16 and the next one is 102 AND BOTH ARE fB
3.Output of the sort operation is of 110 LRECL.
4.I am using ICETOOL which comes with syncsort product usually


Code:


//MYIDNRES JOB (*****,*),                                           
//         'DEEPAK TEST',CLASS=X,MSGCLASS=Y,NOTIFY=&SYSUID           
//S1    EXEC  PGM=ICETOOL                                           
//TOOLMSG DD SYSOUT=*                                               
//DFSMSG  DD SYSOUT=*                                               
//VIN DD DSN=MYID.TEMP.TEST1,DISP=SHR                             
//EXT DD DSN=MYID.TEMP.TEST2,DISP=SHR                             
//T0  DD DSN=&&T0,UNIT=SYSDA,SPACE=(CYL,(700,1700)),DISP=(MOD,PASS) 
//T1  DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(700,1700)),DISP=(MOD,PASS) 
//OUT DD DSN=MYID.TEMP.TEST3,                                     
//             DISP=(NEW,CATLG,DELETE),                             
//             SPACE=(CYL,(700,1700),RLSE)                           
//TOOLIN DD *                                                       
  COPY FROM(EXT) TO(T0) USING(CTL0)                                 
  COPY FROM(VIN) TO(T0) USING(CTL1)                                 
  SPLICE FROM(T0) TO(T1) ON(111,8,PD) -                             
  WITH(103,8)                                                       
  COPY FROM(T1) TO(OUT) USING(CTL2)               
/*                                               
//CTL0CNTL DD *                                   
  OPTION EQUALS                                   
  INREC OVERLAY=(1,102,111:SEQNUM,8,PD)           
/*                                               
//CTL1CNTL DD *                                   
  OPTION EQUALS                                   
  OUTREC FIELDS=(1:102X,103:1,8,111:SEQNUM,8,PD) 
/*                                               
//CTL2CNTL DD *                                   
  OPTION EQUALS                                   
  OUTREC FIELDS=(1,110)                           
/*                                               


Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Mon Jun 15, 2009 9:00 pm
Reply with quote

Hi Sunny.

Assuming that there is a single record in the DATE file, here is a SyncSort for z/OS job that will do what you asked:
Code:
//STEP1 EXEC PGM=SORT                       
//SORTIN  DD DSN=DATA.RECORDS               
//SORTOUT DD DISP=(NEW,PASS),DSN=&&TEMP1   
//SYSOUT  DD SYSOUT=*                       
//SYSIN   DD *                               
   SORT FIELDS=COPY                         
   OUTREC OVERLAY=(103:C'1')               
//*****************************************
//STEP2 EXEC PGM=SORT                       
//SORTIN  DD DSN=DATE.FILE                   
//SORTOUT DD DISP=(NEW,PASS),DSN=&&TEMP2   
//SYSOUT  DD SYSOUT=*                       
//SYSIN   DD *                               
   SORT FIELDS=COPY                         
   OUTREC OVERLAY=(17:C'1')                 
//*****************************************
//STEP3  EXEC PGM=SORT                       
//SORTJNF1 DD DSN=&&TEMP1,DISP=(OLD,DELETE)
//SORTJNF2 DD DSN=&&TEMP2,DISP=(OLD,DELETE)
//SORTOUT  DD SYSOUT=*                       
//SYSOUT   DD SYSOUT=*                       
//SYSIN    DD *                               
   JOINKEYS FILES=F1,FIELDS=(103,1,A)       
   JOINKEYS FILES=F2,FIELDS=(17,1,A)       
   REFORMAT FIELDS=(F1:1,102,F2:9,8)       
   SORT FIELDS=COPY                         
/*                                         
Back to top
View user's profile Send private message
deepuvja

New User


Joined: 06 Mar 2008
Posts: 5
Location: chennai

PostPosted: Mon Jun 15, 2009 9:04 pm
Reply with quote

In my earlier reply
VIN is the date file
EXT is the data file.

Sorry for missing naming conven..
Back to top
View user's profile Send private message
sunnybunny

New User


Joined: 29 Nov 2005
Posts: 49

PostPosted: Tue Jun 16, 2009 12:17 pm
Reply with quote

Hi Deepu,

Thanks for your reply.

ICETOOL is not working in my environment. But anyway thanks for giving the solution.


Regards,
Sunny.
Back to top
View user's profile Send private message
sunnybunny

New User


Joined: 29 Nov 2005
Posts: 49

PostPosted: Tue Jun 16, 2009 12:18 pm
Reply with quote

Hi Alissa,

Thank you so much for your solution.

The solution that you gave me is working fine.

Thanks for your help.

Regards,
Sunny.
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top