Sort Outrec



Support for NetApp SyncSort for z/OS, Visual SyncSort, SYNCINIT, SYNCLIST and SYNCTOOL

Sort Outrec

Postby Ranjana » Mon Jan 25, 2010 3:18 pm

Hi,

I have two input files with 100,000 records. There is an requirement that need to write the values from position 1:9 of input file1 to 3:9 of input file 2.
Example:

Input File 1:
Mainframe12345
job3controllang
dfssortoutrecfl

Input File2:
somevalueshere
somevalueshere
somevalueshere

Output file:
somainframeere
sojob3controre
sodfssortouere

Please let me know how to handle this using DFSORT.

Thx in advance,
Ranjana
Ranjana
 
Posts: 9
Joined: Thu Jan 21, 2010 7:04 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Sort Outrec

Postby skolusu » Mon Jan 25, 2010 11:05 pm

Ranjana,

The following JCL will give the desired results

//STEP0100 EXEC PGM=SORT                           
//SYSOUT   DD SYSOUT=*                             
//INPUT1   DD *                                     
MAINFRAME12345                                     
JOB3CONTROLLANG                                     
DFSSORTOUTRECFL                                     
//INPUT2   DD *                                     
SOMEVALUESHERE                                     
SOMEVALUESHERE                                     
SOMEVALUESHERE                                     
//SORTOUT  DD SYSOUT=*                             
//SYSIN    DD    *                                 
  JOINKEYS F1=INPUT1,FIELDS=(81,8,A),SORTED,NOSEQCK
  JOINKEYS F2=INPUT2,FIELDS=(81,8,A),SORTED,NOSEQCK
  REFORMAT FIELDS=(F2:1,2,F1:1,9,F2:12,3)           
  SORT FIELDS=COPY                                 
//*                                                 
//JNF1CNTL DD *                                     
  INREC OVERLAY=(81:SEQNUM,8,ZD)                   
//*                                                 
//JNF2CNTL DD *                                     
  INREC OVERLAY=(81:SEQNUM,8,ZD)                   
//* 


For complete details on JOINKEYS and the other new functions available with the Nov, 2009 DFSORT PTF, see:

http://www.ibm.com/support/docview.wss? ... g3T7000174
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: Sort Outrec

Postby Chris Eberhart » Mon Jan 25, 2010 11:40 pm

It looks like you want to match records by their relative polistions in the files. First sort each file to a temporary data set adding a sequence number (SEQNUM) to the end of each record.
Using the sequence number, you can now concatenate the temporary files, and match records using a SPLICE operation to overwrite.
If you are not familiar with SEQNUM and SPLICE
Chris Eberhart
 
Posts: 2
Joined: Mon Jan 25, 2010 10:03 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Sort Outrec

Postby Ranjana » Wed Jan 27, 2010 5:33 pm

Thanks a lot!!!
Ranjana
 
Posts: 9
Joined: Thu Jan 21, 2010 7:04 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Sort Outrec

Postby Ranjana » Wed Jan 27, 2010 5:43 pm

Hi,

I am getting the below error,

 SYNCSORT FOR Z/OS  1.3.2.0R    U.S. PATENTS: 4210961, 5117495   (C) 2007 SYNCSO
                                          BNY MELLON - BOSTON   z/OS   1.9.0
 SYNCSORT LICENSED FOR CPU SERIAL NUMBER 84000, MODEL 2094 720             LICEN
 PARMEXIT : VSCORET=12M,MSG=SC
 SYSIN :
   JOINKEYS FILES=F1,FIELDS=(81,8,A),SORTED,NOSEQCK
                                            *
   JOINKEYS FILES=F2,FIELDS=(81,8,A),SORTED,NOSEQCK
                                            *
   REFORMAT FIELDS=(F2:1,2,F1:1,9,F2:12,3)
   SORT FIELDS=COPY
 WER161B  ALTERNATE PARM USED
 WER268A  JOINKEYS STATEMENT: SYNTAX ERROR
 WER268A  JOINKEYS STATEMENT: SYNTAX ERROR
 WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000
 WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
Ranjana
 
Posts: 9
Joined: Thu Jan 21, 2010 7:04 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Sort Outrec

Postby skolusu » Wed Jan 27, 2010 9:47 pm

Ranjana,

The job works fine with DFSORT. Your Error messages indicate you are using syncsort, not DFSORT. I'm a DFSORT developer. DFSORT and Syncsort are competitive products. I'm happy to answer questions on DFSORT and DFSORT's ICETOOL, but I don't answer questions on Syncsort.

I wasn't sure which product you were using - you posted this in the Syncsort Forum, but in your original post, you said:

Please let me know how to handle this using DFSORT.


I don't know why you asked how to handle this with DFSORT if you're using Syncsort.
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: Sort Outrec

Postby Alissa Margulies » Wed Jan 27, 2010 11:38 pm

Here is a SyncSort for z/OS job that will do what you asked:
//S1     EXEC PGM=SORT                                         
//SYSOUT   DD SYSOUT=*                                         
//SORTIN   DD *                                                 
MAINFRAME12345                                                 
JOB3CONTROLLANG                                                 
DFSSORTOUTRECFL                                                 
//SORTOUT  DD DISP=(NEW,PASS),DSN=&&IN1
//SYSIN    DD *                                             
  SORT FIELDS=COPY                                             
  OUTREC OVERLAY=(81:SEQNUM,8,ZD)                               
/*                                                             
//S2     EXEC PGM=SORT                                         
//SYSOUT   DD SYSOUT=*                                         
//SORTIN   DD *                                                 
SOMEVALUESHERE                                                 
SOMEVALUESHERE                                                 
SOMEVALUESHERE                                                 
//SORTOUT  DD DISP=(NEW,PASS),DSN=&&IN2
//SYSIN    DD *                                             
  SORT FIELDS=COPY                                             
  OUTREC OVERLAY=(81:SEQNUM,8,ZD)                               
/*                                                             
//S3     EXEC PGM=SORT                     
//SYSOUT   DD SYSOUT=*                     
//SORTJNF1 DD DISP=SHR,DSN=&&IN1           
//SORTJNF2 DD DISP=SHR,DSN=&&IN2           
//SORTOUT  DD SYSOUT=*                     
//SYSIN    DD *                         
  JOINKEYS FILES=F1,FIELDS=(81,8,A),SORTED 
  JOINKEYS FILES=F2,FIELDS=(81,8,A),SORTED
  REFORMAT FIELDS=(F2:1,2,F1:1,9,F2:12,3) 
  SORT FIELDS=COPY       
/*
Alissa Margulies
Syncsort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Alissa Margulies
Global moderator
 
Posts: 369
Joined: Tue Feb 26, 2008 11:15 pm
Location: USA
Has thanked: 1 time
Been thanked: 3 times

Re: Sort Outrec

Postby Ranjana » Tue Feb 02, 2010 6:12 pm

Thanks a lot:-)
Now it is working fine.
Ranjana
 
Posts: 9
Joined: Thu Jan 21, 2010 7:04 pm
Has thanked: 0 time
Been thanked: 0 time


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post