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

Provide me the JCL for obtaining the above output


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sankar_MF

New User


Joined: 19 Sep 2006
Posts: 29

PostPosted: Wed Nov 22, 2006 12:32 pm
Reply with quote

Hi All,

I am having Two PS Files as following...

File 1 : RECL = 80
-----------------------

984215 MIT
965487 SIT
123214 MIL
124577 SIM

File 2 : RECL = 80
-----------------------

MIT CODE34
SIT CODE12
MIL CODE25
SIM CODE14

I want the output file as following

Output File
-------------

984215 MIT CODE34
965487 SIT CODE12
123214 MIL CODE25
124577 SIM CODE14

Can u please provide me the JCL for obtaining the above output.


Thanks
Sankar
Back to top
View user's profile Send private message
vana

New User


Joined: 27 Jul 2006
Posts: 6

PostPosted: Wed Nov 22, 2006 3:05 pm
Reply with quote

Hi,


U can use SPLICE operator to perform this. Here is the syntax

//DFSORT EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//FIN1 DD DSN=... filename1
//FIN2 DD DSN=... filename2
//T1 DD DSN=&&TEMP1,DISP=(MOD,PASS),SPACE=(TRK,(5,5)),UNIT=SYSDA
//OUT DD DSN=... output filename
//TOOLIN DD *
//* Reformat the first file
COPY FROM(FIN1) TO(T1) USING(CTL1)
//*Reformat the second file
COPY FROM(FIN2) TO(T1) USING(CTL2)
//* Splice records with matching keys
SPLICE FROM(T1) TO(OUT) ON(8,3,CH) WITH(8,3) ?
WITH(12,6)
/*
//CTL1CNTL DD *
OUTREC FIELDS=(1:1,6,8:7,3,11:7X)
/*
//CTL2CNTL DD *
OUTREC FIELDS=(8:1,3,12:5,6)
/*

Please let me know if it is wrong...

Thanks,
Vana
Back to top
View user's profile Send private message
sankar_MF

New User


Joined: 19 Sep 2006
Posts: 29

PostPosted: Wed Nov 22, 2006 5:21 pm
Reply with quote

Hi,

I am unable to get the output with this JCL.
Nothing is written into the Output File.
Back to top
View user's profile Send private message
subhasis_50

Moderator


Joined: 09 Mar 2005
Posts: 363
Location: Earth

PostPosted: Wed Nov 22, 2006 7:09 pm
Reply with quote

Hi,
Please try this one
Code:

//STEP0100 EXEC PGM=ICETOOL                   
//*                                           
//TOOLMSG  DD SYSOUT=*                         
//DFSMSG   DD SYSOUT=*                         
//IN1      DD *                               
MIT CODE34                                     
SIT CODE12                                     
MIL CODE25                                     
SIM CODE14                                     
/*                                             
//T1       DD DSN=&&TEMPFILE,UNIT=SYSDA,DISP=(,PASS),     
//             SPACE=(TRK,(1,1),RLSE)                     
//IN2      DD DSN=*.T1,VOL=REF=*.T1,DISP=(OLD,PASS)       
//         DD *                                           
984215 MIT                                                 
965487 SIT                                                 
123214 MIL                                                 
124577 SIM                                                 
/*                                                         
//OUT      DD SYSOUT=*                                     
//TOOLIN   DD *                                           
   COPY FROM(IN1) TO(T1) USING(CTL1)                       
   SPLICE FROM(IN2) TO(OUT) ON(8,3,CH) WITHALL WITH(1,7)   
/*                                                         
//CTL1CNTL DD *                                           
   OUTREC FIELDS=(8:1,3,12:5,6,80:X)                       
/*


Hope it helps!
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Nov 22, 2006 9:19 pm
Reply with quote

Sankar,

Here's a DFSORT/ICETOOL job that will do what you asked for. I assumed the following positions for your fields:

File1

Field 1 in positions 1-6
Field 2 in positions 9-11

File2

Field 1 in positions 1-3
Field 2 in positions 5-10

The extra SORT operator is needed to get the spliced records back into their original order as shown in your example.

Code:

//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DSN=... input file1 (FB/80)
//IN2 DD DSN=... input file2 (FB/80)
//T1 DD DSN=&&T1,DISP=(MOD,PASS),SPACE=(TRK,(5,5)),UNIT=SYSDA
//T2 DD DSN=&&T2,DISP=(,PASS),SPACE=(TRK,(5,5)),UNIT=SYSDA
//OUT DD DSN=... outputf file
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SPLICE FROM(T1) TO(T2) ON(9,3,CH) WITH(13,6)
SORT FROM(T2) TO(OUT) USING(CTL3)
/*
//CTL1CNTL DD *
  INREC OVERLAY=(81:SEQNUM,8,ZD)
/*
//CTL2CNTL DD *
  INREC BUILD=(9:1,3,13:5,6,88:X)
/*
//CTL3CNTL DD *
  SORT FIELDS=(81,8,ZD,A)
  OUTREC BUILD=(1,80)
/*
Back to top
View user's profile Send private message
sankar_MF

New User


Joined: 19 Sep 2006
Posts: 29

PostPosted: Fri Nov 24, 2006 12:12 pm
Reply with quote

Thank you very much Frank....
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts Joinkeys - 5 output files DFSORT/ICETOOL 7
No new posts Build a record in output file and rep... DFSORT/ICETOOL 11
No new posts XDC SDSF output to temp dataset CLIST & REXX 4
Search our Forums:

Back to Top