MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

From syncsort to dfsort

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
edkir98
Beginner


Joined: 27 Aug 2007
Posts: 102
Topics: 42
Location: Chennai

PostPosted: Wed Sep 10, 2008 7:55 am    Post subject: From syncsort to dfsort Reply with quote

I moved over from a group where we were using SYNCSORT and now in this new group we are using DFSORT. I wanted to use JOINKEYS utility of syncsort. I found from the forum that its equivalent in DFSORT is SPLICE. But I'm confused.

I tried executing a sample JCL from Frank's post which was quoted in http://www.mvsforums.com/helpboards/viewtopic.php?t=2951&highlight=duplicate+splice. But am getting an error. Can someone please explain the logic of how its happening?

This is the JCL I used
Code:

//S1  EXEC PGM=ICETOOL                                         
//TOOLMSG  DD  SYSOUT=*                                         
//DFSMSG   DD  SYSOUT=*                                         
//IN1   DD *                                                   
123456 IDSX                                                     
567015 IDSY                                                     
345678 IDSX                                                     
906615 IDSY                                                     
//IN2   DD *                                                   
123456 XXA .....                                               
30000  ABC .....                                               
123456 DEF......                                               
345678 FGH......                                               
567015 NOM......                                               
345678 ETI......                                               
906615 LKG......                                               
//TEMP1 DD DSN=&&TEMP1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//TEMP2 DD DSN=&&TEMP2,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//CON   DD DSN=*.TEMP1,VOL=REF=*.TEMP1,DISP=(OLD,PASS)         
//      DD DSN=*.TEMP2,VOL=REF=*.TEMP2,DISP=(OLD,PASS)         
//OUT1  DD DSN=&&O1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)   
//OUT2  DD SYSOUT=*                                             
//TOOLIN DD *                                                   
* IN1->T1:  REFORMAT RECORDS TO:                               
* |KEY|.......|IDSX|...|A|...|BLANKS|                           
COPY FROM(IN1) TO(TEMP1) USING(CTL1)                           
* IN2->T2:  REFORMAT RECORDS TO:                               
* |KEY|XXX|..................|SEQNUM|                           
COPY FROM(IN2) TO(TEMP2) USING(CTL2)                           
* T1/T2->OUT1:  SPLICE TO GET:                                 
* |KEY|XXX|...|IDSX|...|A|...|SEQNUM|                           
* KEY, IDSX AND A COME FROM BASE RECORDS (T1)                   
* XXX AND SEQNUM COME FROM OVERLAY RECORDS (T2)                 
SPLICE FROM(CON) TO(OUT1) ON(1,9,CH) -                         
  WITHALL WITH(10,3) WITH(447,8) KEEPNODUPS                     
* SORT ON SEQNUM TO GET THE SPLICED RECORDS BACK               
* IN THEIR ORIGINAL IN2 ORDER.  REMOVE SEQNUM.                 
SORT FROM(OUT1) TO(OUT2) USING(CTL3)                           
/*                                                           
//CTL1CNTL DD *                                               
  OUTREC FIELDS=(1,9,156:10,6,                               
          366:10,6,CHANGE=(1,C'IDSX  ',C'I',                 
                              C'IDSY',C'J'),                 
                    NOMATCH=(C' '),                           
                    447:8X)                                   
/*                                                           
//CTL2CNTL DD *                                               
  OUTREC FIELDS=(1,446,447:SEQNUM,8,ZD)                       
/*                                                           
//CTL3CNTL DD *                                               
  SORT FIELDS=(447,8,ZD,A)                                   
  OUTREC FIELDS=(1,446)                                       
/*                                                           


and this is the error I got
Code:

ICE201I E RECORD TYPE IS F - DATA STARTS IN POSITION 1
ICE027A 6 END OF          FIELD BEYOND MAXIMUM RECORD LENGTH

Can someone help? Also can you please explain the control card? It was a bit straightforward in SYNCSORT...
Code:

  OUTREC FIELDS=(1,9,156:10,6,                               
          366:10,6,CHANGE=(1,C'IDSX  ',C'I',                 
                              C'IDSY',C'J'),                 
                    NOMATCH=(C' '),                           
                    447:8X)

_________________
Thanks
Back to top
View user's profile Send private message Yahoo Messenger
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12380
Topics: 75
Location: San Jose

PostPosted: Wed Sep 10, 2008 10:56 am    Post subject: Reply with quote

edkir98,

I appreciate you putting an effort to search before posting. However you have chose a post which is 4 years old and a lot more feature have been added to DFSORT.

Quote:
Can someone help? Also can you please explain the control card? It was a bit straightforward in SYNCSORT...


Frank has put a lot of effort in documentation and making it very easy to understand. Full documentation on ICETOOL is included in the DFSORT publications. For example, the "DFSORT Application Programming Guide" has Chapter 6, "Using ICETOOL".

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA00/CCONTENTS

He has several examples on splice explaining in detail. The DFSORT website has a ton of information on DFSORT and ICETOOL. "DFSORT: Getting Started" is the best way to learn about DFSORT and ICETOOL - you can find it online at:

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CG00/CCONTENTS

Now coming to the reason for your error. You are using an instream data of 80 bytes and the control cards are trying to reformat the postions at pos 159 which is beyond the max lrecl of 80.

Here is a updated DFSORT/ICETOOL job which will give you the desired results.

You have 2 files. File1 is a unique key file and File 2 is a duplicate key file.

The first copy operator takes the unique file and pads the data to be populated at the end of every record and also adds an indicator '11'

This is how the data looks like after the first copy

Code:

----+----1----+----2----+----3                   8----+----9----+----0---
123456 IDSX                                        IDSX11
567015 IDSY                                        IDSY11
345678 IDSX                                        IDSX11
906615 IDSY                                        IDSY11

The second copy operator takes the dups file and pads with 5 spaces to accomadate the data from file at the end of every record and also adds an indicator '22'

This is how the data looks like after the second copy
Code:

----+----1----+----2----+----3                   8----+----9----+----0---
123456 XXA .....                                       22
30000  ABC .....                                       22
30000  JHK                                             22
123456 DEF .....                                       22
345678 FGH .....                                       22
567015 NOM .....                                       22
345678 ETI .....                                       22
906615 LKG .....                                       22
786345 ETI .....                                       22


The temporary dataset T1 has disp=mod which would append the records from both files as one and this is how it looks like

Code:

----+----1----+----2----+----3                   8----+----9----+----0---
123456 IDSX                                        IDSX11
567015 IDSY                                        IDSY11
345678 IDSX                                        IDSX11
906615 IDSY                                        IDSY11
123456 XXA .....                                       22
30000  ABC .....                                       22
30000  JHK                                             22
123456 DEF .....                                       22
345678 FGH .....                                       22
567015 NOM .....                                       22
345678 ETI .....                                       22
906615 LKG .....                                       22
786345 ETI .....                                       22


Now we use splice to copy over the contents from the unique file on to the duplicate file. After the completion of the splice the records looks like this

Code:

----+----1----+----2----+----3                   8----+----9----+----0---
123456 IDSX                                        IDSX11
123456 XXA .....                                   IDSX12
123456 DEF .....                                   IDSX12
30000  ABC .....                                       22
30000  JHK                                             22
345678 IDSX                                        IDSX11
345678 FGH .....                                   IDSX12
345678 ETI .....                                   IDSX12
567015 IDSY                                        IDSY11
567015 NOM .....                                   IDSY12
786345 ETI .....                                       22
906615 IDSY                                        IDSY11
906615 LKG .....                                   IDSY12


Now all the records that have a match are tagged with '12' and all the records which do not have a match with unique file are tagged with '22' Using an Include cond we only pick these records and we also move the data to be populated using a build card and there by creating the desired output

Code:

----+----1----+----2----+----3
123456 XXA .....     IDSX
123456 DEF .....     IDSX
30000  ABC .....         
30000  JHK               
345678 FGH .....     IDSX
345678 ETI .....     IDSX
567015 NOM .....     IDSY
786345 ETI .....         
906615 LKG .....     IDSY


Code:

//STEP0100 EXEC PGM=ICETOOL                                   
//TOOLMSG  DD SYSOUT=*                                         
//DFSMSG   DD SYSOUT=*                                         
//IN1      DD *                                               
123456 IDSX                                                   
----+----1----+----2----+----3----+----4----+----5----+----6---
567015 IDSY                                                   
345678 IDSX                                                   
906615 IDSY                                                   
//IN2      DD *                                               
123456 XXA .....                                               
30000  ABC .....                                               
30000  JHK                                                     
123456 DEF .....                                               
345678 FGH .....                                               
567015 NOM .....                                               
345678 ETI .....                                               
906615 LKG .....                                               
786345 ETI .....                                               
//T1       DD DSN=&&T1,DISP=(MOD,PASS),SPACE=(CYL,(1,1),RLSE) 
//OUT      DD SYSOUT=* 
//TOOLIN   DD *                                             
  COPY FROM(IN1) USING(CTL1)                               
  COPY FROM(IN2) USING(CTL2)                               
  SPLICE FROM(T1) TO(OUT) ON(1,6,CH) KEEPBASE KEEPNODUPS - 
  WITHALL WITH(01,80) WITH(87,1) USING(CTL3)               
//CTL1CNTL DD *                                             
  OUTFIL FNAMES=T1,OVERLAY=(81:7,5,C'11')                   
//CTL2CNTL DD *                                             
  OUTFIL FNAMES=T1,OVERLAY=(81:5X,C'22')                   
//CTL3CNTL DD *                                             
  OUTFIL FNAMES=OUT,BUILD=(1,20,81,5),                     
  INCLUDE=(86,2,SS,EQ,C'12,22')                             
/*


Hope this helps...

Cheers
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
edkir98
Beginner


Joined: 27 Aug 2007
Posts: 102
Topics: 42
Location: Chennai

PostPosted: Fri Sep 12, 2008 8:27 am    Post subject: Reply with quote

Hi Kolusu.. Thanks a ton!!
_________________
Thanks
Back to top
View user's profile Send private message Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group