Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Provide me the JCL for obtaining the above output

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Provide me the JCL for obtaining the above output
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    Post subject: Re: Provide me the JCL for obtaining the above output
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    Post subject:
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    Post subject: Re: Provide me the JCL for obtaining the above output
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 Moderator


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

PostPosted: Wed Nov 22, 2006 9:19 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Problem reading GTF trace output danik56 ABENDS & Debugging 7 Thu Mar 16, 2017 1:02 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts How to get current date -1 and curren... murali.andaluri DFSORT/ICETOOL 3 Wed Mar 08, 2017 2:09 pm
No new posts Incorrect output when trying to add n... monica1 PL/I & Assembler 10 Fri Jan 13, 2017 5:02 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us