Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Date in final file using SYNCSORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Date in final file using SYNCSORT
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    Post subject:
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: 500
Location: USA

PostPosted: Mon Jun 15, 2009 9:00 pm    Post subject:
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    Post subject: re...
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    Post subject: Reply to: Date in final file using SYNCSORT
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    Post subject: Reply to: Date in final file using SYNCSORT
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Validate the Date girishb2 DFSORT/ICETOOL 9 Tue Sep 19, 2017 1:12 am
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts BUILD OUTFIL based on condition other... balaji81_k DFSORT/ICETOOL 13 Fri Sep 08, 2017 11:06 pm
No new posts Julian Date to CICS ABSTTIME blayek CICS 3 Wed Aug 30, 2017 11:15 pm
No new posts Skip file from delete pema_yozer All Other Mainframe Topics 3 Tue Aug 29, 2017 3:19 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us