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 

Vertical merge of first record with second record
Goto page 1, 2  Next
 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
kavi
Beginner


Joined: 15 Sep 2006
Posts: 64
Topics: 22

PostPosted: Thu Dec 20, 2007 8:35 am    Post subject: Vertical merge of first record with second record Reply with quote

Hi all,

Here is my requirement

My Input file is,
Code:

AAAAAAAAAA
11111111
BBBBBBBBBB
22222222
CCCCCCCCCC
33333333


First record is of 10 bytes and second is of 8 Bytes. I need to merge (Vertical) first record with second and my output should be

Code:

AAAAAAAAAA 11111111
BBBBBBBBBB 22222222
CCCCCCCCCC 33333333


I can achive this by three steps using SORT, please help on this to achive in single step. (Using SORT)

Thanks in advance
Kavi
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Thu Dec 20, 2007 11:15 am    Post subject: Reply with quote

kavi,

Please search before posting. Check this link

http://www.mvsforums.com/helpboards/viewtopic.php?p=36873#36873

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
krisprems
Beginner


Joined: 13 Dec 2006
Posts: 101
Topics: 4
Location: india

PostPosted: Fri Dec 21, 2007 12:47 am    Post subject: Reply with quote

hi
Hope this ICETOOL JCL(single pass solution) helps
Code:
//*******************************************************
//STEP001  EXEC PGM=ICETOOL                             
//TOOLMSG  DD SYSOUT=*                                   
//DFSMSG   DD SYSOUT=*                                   
//INPUT    DD *                                         
AAAAAAAAAA                                               
11111111                                                 
BBBBBBBBBB                                               
22222222                                                 
CCCCCCCCCC                                               
33333333                                                 
DDDDDDDDDD                                               
/*                                                       
//OUTPUT   DD SYSOUT=*                                   
//TOOLIN   DD *                                         
 SPLICE FROM(INPUT) TO(OUTPUT) ON(81,8,ZD) WITH(12,8)-   
                            USING(NKK1) KEEPNODUPS       
/*                                                       
//NKK1CNTL DD   *                                       
  INREC IFTHEN=(WHEN=(9,1,CH,EQ,C' '),BUILD=(12:1,8,81:SEQNUM,8,ZD)),
        IFTHEN=(WHEN=NONE,OVERLAY=(81:SEQNUM,8,ZD))                 
  OUTFIL FNAMES=OUTPUT,BUILD=(1,80)                                               
/*                                                                   

_________________
cHEERs
krisprems
Back to top
View user's profile Send private message
vkphani
Intermediate


Joined: 05 Sep 2003
Posts: 483
Topics: 48

PostPosted: Fri Dec 21, 2007 1:18 am    Post subject: Reply with quote

kavi,

I don't think it is possible to achieve what you want in single step.
The below code will give you the desired reults.
Code:

//STEP01 EXEC PGM=ICEMAN                                   
//SYSOUT DD SYSOUT=                                       
//SORTIN DD *                                             
AAAAAAAAAA                                                 
11111111                                                   
BBBBBBBBBB                                                 
22222222                                                   
CCCCCCCCCC                                                 
33333333                                                   
//OUT1 DD DSN=&&T1,DISP=(MOD,PASS),SPACE=(CYL,(10,10),RLSE)
//OUT2 DD DSN=&&T2,DISP=(MOD,PASS),SPACE=(CYL,(10,10),RLSE)
//SYSIN DD *                                               
  OPTION COPY                                             
  OUTFIL FNAMES=OUT1,INCLUDE=(1,4,FS,NE,NUM)               
  OUTFIL FNAMES=OUT2,INCLUDE=(1,4,FS,EQ,NUM)               
/*                                                         
//STEP02   EXEC PGM=ICETOOL                                           
//TOOLMSG  DD SYSOUT=*                                               
//DFSMSG   DD SYSOUT=*                                               
//IN1      DD DSN=&&T1,DISP=SHR                                       
//IN2      DD DSN=&&T2,DISP=SHR                                       
//TMP1     DD DSN=&&TEMP1,DISP=(MOD,PASS),SPACE=(TRK,(5,5)),UNIT=SYSDA
//OUT      DD SYSOUT=*                                               
//TOOLIN   DD *                                                       
   COPY FROM(IN1) TO(TMP1) USING(CTL1)                               
   COPY FROM(IN2) TO(TMP1) USING(CTL2)                               
   SPLICE FROM(TMP1) TO(OUT) ON(20,8,PD) WITH(12,8) USING(CTL3)       
/*                                                                   
//CTL1CNTL DD *                                                       
   OUTREC FIELDS=(1:1,10,20:SEQNUM,8,PD)                             
/*                                                                   
//CTL2CNTL DD *                                                       
   OUTREC FIELDS=(12:1,8,20:SEQNUM,8,PD)                             
/*                                                                   
//CTL3CNTL DD *                                                       
   OUTFIL FNAMES=OUT,OUTREC=(1,20)                                   
/*                                                                                             


OUT:
Code:

AAAAAAAAAA 1111111
BBBBBBBBBB 2222222
CCCCCCCCCC 3333333


Last edited by vkphani on Fri Dec 21, 2007 1:29 am; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
vkphani
Intermediate


Joined: 05 Sep 2003
Posts: 483
Topics: 48

PostPosted: Fri Dec 21, 2007 1:26 am    Post subject: Reply with quote

krisprems,
Your job gave me the error.
Back to top
View user's profile Send private message Send e-mail
vkphani
Intermediate


Joined: 05 Sep 2003
Posts: 483
Topics: 48

PostPosted: Fri Dec 21, 2007 1:32 am    Post subject: Reply with quote

kolusu wrote:
kavi,

Please search before posting. Check this link

http://www.mvsforums.com/helpboards/viewtopic.php?p=36873#36873

Hope this helps...

Cheers

Kolusu,
I executed the code in the above link but it did not give what OP wants.
Back to top
View user's profile Send private message Send e-mail
vkphani
Intermediate


Joined: 05 Sep 2003
Posts: 483
Topics: 48

PostPosted: Fri Dec 21, 2007 1:47 am    Post subject: Reply with quote

You can use the below code if records with even serial number are not numeric.
Code:

//STEP0100 EXEC PGM=ICETOOL                                 
//TOOLMSG   DD SYSOUT=*                                     
//DFSMSG    DD SYSOUT=*                                     
//IN        DD *                                           
AAAAAAAAAA                                                 
11111111                                                   
BBBBBBBBBB                                                 
22222222                                                   
CCCCCCCCCC                                                 
33333333                                                   
//OUT       DD  DSN=&&T1,DISP=(MOD,PASS),SPACE=(CYL,(10,10),RLSE)
//TOOLIN    DD *                                           
  SPLICE FROM(IN) TO(OUT) WITHEACH -                       
      ON(161,8,CH)                 -                       
    WITH(081,80)                   -                       
  KEEPNODUPS USING(CTL1)                                   
//CTL1CNTL     DD *                                           
  INREC IFTHEN=(WHEN=INIT,                                     
       OVERLAY=(001:01,80,                                     
                081:01,80,                                     
                161:SEQNUM,8,ZD,START=2,INCR=1,               
                169:161,8,ZD,MOD,+2,TO=ZD,LENGTH=1),HIT=NEXT),
                                                               
        IFTHEN=(WHEN=(169,1,ZD,EQ,0),                         
       OVERLAY=(081:80X,                                       
                161:161,8,ZD,SUB,169,1,ZD,M11,LENGTH=8)),     
                                                               
        IFTHEN=(WHEN=(169,1,ZD,EQ,1),                         
       OVERLAY=(001:80X,                                       
                161:161,8,ZD,SUB,169,1,ZD,M11,LENGTH=8))       
                                                               
   OUTFIL FNAMES=OUT,                                         
   OUTREC=(001,160)                                           
/*                                                             
//STEP0200 EXEC PGM=ICETOOL                                   
//TOOLMSG   DD SYSOUT=*                                       
//DFSMSG    DD SYSOUT=*                                       
//IN        DD *                                             
AAAAAAAAAA                                                   
11111111                                                     
BBBBBBBBBB                                                   
22222222                                                     
CCCCCCCCCC                                                   
33333333                                                     
//OUT       DD DSN=&&T2,DISP=(MOD,PASS),SPACE=(CYL,(10,10),RLSE)
//TOOLIN    DD *                                             
  SPLICE FROM(IN) TO(OUT) WITHEACH -                         
      ON(161,8,CH)                 -                         
    WITH(081,80)                   -                         
  KEEPNODUPS USING(CTL1)                                     
//CTL1CNTL     DD *                                           
  INREC IFTHEN=(WHEN=INIT,                                     
       OVERLAY=(001:01,80,                                     
                081:01,80,                                     
                161:SEQNUM,8,ZD,START=1,INCR=1,               
                169:161,8,ZD,MOD,+2,TO=ZD,LENGTH=1),HIT=NEXT),
                                                               
        IFTHEN=(WHEN=(169,1,ZD,EQ,0),                         
       OVERLAY=(081:80X,                                       
                161:161,8,ZD,SUB,169,1,ZD,M11,LENGTH=8)),     
                                                               
        IFTHEN=(WHEN=(169,1,ZD,EQ,1),                         
       OVERLAY=(001:80X,                                       
                161:161,8,ZD,SUB,169,1,ZD,M11,LENGTH=8))       
                                                               
   OUTFIL FNAMES=OUT,                                         
   OUTREC=(001,160)                                           
/*               
//STEP0300   EXEC PGM=ICETOOL                                           
//TOOLMSG  DD SYSOUT=*                                               
//DFSMSG   DD SYSOUT=*                                               
//IN1      DD DSN=&&T1,DISP=SHR                                       
//IN2      DD DSN=&&T2,DISP=SHR                                       
//TMP1     DD DSN=&&TEMP1,DISP=(MOD,PASS),SPACE=(TRK,(5,5)),UNIT=SYSDA
//OUT      DD SYSOUT=*                                               
//TOOLIN   DD *                                                       
   COPY FROM(IN1) TO(TMP1) USING(CTL1)                               
   COPY FROM(IN2) TO(TMP1) USING(CTL2)                               
   SPLICE FROM(TMP1) TO(OUT) ON(20,8,PD) WITH(12,8) USING(CTL3)       
/*                                                                   
//CTL1CNTL DD *                                                       
   OUTREC FIELDS=(1:1,10,20:SEQNUM,8,PD)                             
/*                                                                   
//CTL2CNTL DD *                                                       
   OUTREC FIELDS=(12:1,8,20:SEQNUM,8,PD)                             
/*                                                                   
//CTL3CNTL DD *                                                       
   OUTFIL FNAMES=OUT,OUTREC=(1,20)                                   
/*                                                                                             
                     
Back to top
View user's profile Send private message Send e-mail
vivek1983
Intermediate


Joined: 20 Apr 2006
Posts: 222
Topics: 24

PostPosted: Fri Dec 21, 2007 2:31 am    Post subject: Reply with quote

Hi,

Quote:

krisprems,
Your job gave me the error.


I didnt get any error. It ran fine and gave the desired output. Rolling Eyes
_________________
Vivek G
--------------------------------------
A dream is just a dream. A goal is a dream with a plan and a deadline. (Harvey Mackay)
Back to top
View user's profile Send private message
krisprems
Beginner


Joined: 13 Dec 2006
Posts: 101
Topics: 4
Location: india

PostPosted: Fri Dec 21, 2007 2:52 am    Post subject: Reply with quote

vkphani,
Quote:
krisprems,
Your job gave me the error.

Please post your spool messages, so that i could help you!!
_________________
cHEERs
krisprems
Back to top
View user's profile Send private message
vkphani
Intermediate


Joined: 05 Sep 2003
Posts: 483
Topics: 48

PostPosted: Fri Dec 21, 2007 2:53 am    Post subject: Reply with quote

vivek1983 wrote:
Hi,

Quote:

krisprems,
Your job gave me the error.


I didnt get any error. It ran fine and gave the desired output. Rolling Eyes


I got the below error.
Code:
ICE056A 9 NKK1OUT  NOT DEFINED                             
ICE751I 0 C5-K90007 C6-K90007 C7-K90000 C8-K90007 E7-K11698
ICE052I 3 END OF DFSORT                                   
Back to top
View user's profile Send private message Send e-mail
krisprems
Beginner


Joined: 13 Dec 2006
Posts: 101
Topics: 4
Location: india

PostPosted: Fri Dec 21, 2007 3:11 am    Post subject: Reply with quote

vkphani,
Paste your TOOLIN card here...
_________________
cHEERs
krisprems
Back to top
View user's profile Send private message
vkphani
Intermediate


Joined: 05 Sep 2003
Posts: 483
Topics: 48

PostPosted: Fri Dec 21, 2007 3:16 am    Post subject: Reply with quote

krisprems wrote:
vkphani,
Paste your TOOLIN card here...


krisprems
Complete code is below.
Code:
//STEP001  EXEC PGM=ICETOOL                                         
//TOOLMSG  DD SYSOUT=*                                               
//DFSMSG   DD SYSOUT=*                                               
//INPUT    DD *                                                     
AAAAAAAAAA                                                           
11111111                                                             
BBBBBBBBBB                                                           
22222222                                                             
CCCCCCCCCC                                                           
33333333                                                             
DDDDDDDDDD                                                           
/*                                                                   
//OUTPUT   DD SYSOUT=*                                               
//TOOLIN   DD *                                                     
 SPLICE FROM(INPUT) TO(OUTPUT) ON(81,8,ZD) WITH(12,8)-               
                            USING(NKK1) KEEPNODUPS                   
/*                                                                   
//NKK1CNTL DD   *                                                   
  INREC IFTHEN=(WHEN=(9,1,CH,EQ,C' '),BUILD=(12:1,8,81:SEQNUM,8,ZD)),
        IFTHEN=(WHEN=NONE,OVERLAY=(81:SEQNUM,8,ZD))                 
  OUTFIL FNAMES=OUTPUT,BUILD=(1,80)                                               
/*                                                                   
Back to top
View user's profile Send private message Send e-mail
vivek1983
Intermediate


Joined: 20 Apr 2006
Posts: 222
Topics: 24

PostPosted: Fri Dec 21, 2007 4:22 am    Post subject: Reply with quote

vkphani,

The code above works perfect...
I am just wondering why it had thrown an error for u... Something strange.. Confused
_________________
Vivek G
--------------------------------------
A dream is just a dream. A goal is a dream with a plan and a deadline. (Harvey Mackay)
Back to top
View user's profile Send private message
krisprems
Beginner


Joined: 13 Dec 2006
Posts: 101
Topics: 4
Location: india

PostPosted: Fri Dec 21, 2007 4:46 am    Post subject: Reply with quote

i dont know if you have specified a DD name called NKK1OUT any where Rolling Eyes
_________________
cHEERs
krisprems
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Fri Dec 21, 2007 10:18 am    Post subject: Reply with quote

Quote:
I am just wondering why it had thrown an error for u... Something strange


The error is caused by not having FNAMES=OUTPUT in the OUTFIL statement. DFSORTs ICETOOL requires FNAMES=ddname for the OUTFIL statement in xxxxCNTL with SPLICE USING(xxxx). The ddname must match the one in TO(ddname). I'll modify the jobs to have FNAMES.
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Goto page 1, 2  Next
Page 1 of 2

 
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