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

SPLICE OPERATOR for Pulling matching Field from Master File.


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
manoopatil

New User


Joined: 07 Dec 2003
Posts: 56
Location: Montreal

PostPosted: Thu Sep 18, 2008 9:08 pm
Reply with quote

I have one Transaction file and one Master file. Master file contains the mapping of Print id and Report Id. However Transaction File has only Print Id. I want to get a output transaction file which will have both Print Id and Report Id for all the records. In other words for each transaction record I want to pull the report id field from Master file. Here are the sample data from two files and expected output. I tried to do it with ICETOOL and SPLICE operator. But not getting the required results. Any suggestion is appreciated!

Transaction Records:

AY19501 5286
AY19501 5287
AY19501 5288
AY19505 5286
AY19505 5287
AY19506 5286
AY19506 5287

Master Records:

AY19501 RPT=RAY19501
AY19505 RPT=RAY19505
AY19506 RPT=RAY19506

Expected Output:

AY19501 RAY19501 5286
AY19501 RAY19501 5287
AY19501 RAY19501 5288
AY19505 RAY19505 5286
AY19505 RAY19505 5287
AY19506 RAY19506 5286
AY19506 RAY19506 5287
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu Sep 18, 2008 9:44 pm
Reply with quote

manopatil,

Assuming that both master and trans file are of same length,you can do this kind of thing more easily and efficiently with the new WHEN=GROUP function of DFSORT available with z/OS DFSORT V1R5 PTF UK90013 (July, 2008) like this

Code:

//STEP0100 EXEC PGM=ICEMAN                               
//SYSOUT   DD SYSOUT=*                                   
//SORTIN   DD DSN=YOUR MASTER FILE,DISP=SHR
//         DD DSN=YOUR TRANS FILE,DISP=SHR
//SORTOUT  DD SYSOUT=*                                   
//SYSIN    DD *                                         
  SORT FIELDS=(1,7,CH,A)                                 
  OUTREC IFTHEN=(WHEN=GROUP,                             
         BEGIN=(9,4,CH,EQ,C'RPT='),PUSH=(81:13,8))       
  OUTFIL INCLUDE=(81,8,CH,GT,C' ',AND,9,4,CH,NE,C'RPT='),
  BUILD=(1,8,81,8,8,5)                                   
/*                                                       


For complete details on the WHEN=GROUP function and the other new functions available with PTF UK90013, see:

Use [URL] BBCode for External Links


Hope this helps...

Cheers
Back to top
View user's profile Send private message
manoopatil

New User


Joined: 07 Dec 2003
Posts: 56
Location: Montreal

PostPosted: Sat Sep 27, 2008 2:02 am
Reply with quote

Thanks for the suggestion.

I tried the ICETOOL as per your suggestion but JCL shows me the syntax error in "OUTREC" or "INREC" field. I dont understand what is wrong. Please suggest

IEF375I JOB/DSTSPLT /START 2008270.1627
IEF376I JOB/DSTSPLT /STOP 2008270.1627 CPU 0MIN 00.02SEC SRB 0MIN 00.00S
SYNCSORT FOR Z/OS 1.2.2.3R U.S. PATENTS: 4210961, 5117495 (C) 2005 SYNCSO
z/OS 1.8.0
PRODUCT LICENSED FOR CPU SERIAL NUMBER 1C2AD, MODEL 2096 U03 LICEN
SYSIN :
OPTION COPY
INREC IFTHEN=(WHEN=GROUP,
*
BEGIN=(9,4,CH,EQ,C'RPT='),PUSH=(41:13,8))
OUTFIL INCLUDE=(41,8,CH,GT,C' ',AND,9,4,CH,NE,C'RPT='),
BUILD=(1,8,41,8,13,5)
WER268A INREC STATEMENT : SYNTAX ERROR
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Sat Sep 27, 2008 2:36 am
Reply with quote

You are not using dfsort but syncsort...
WER..... messages

I' ll move the topic to the jcl forum
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Sat Sep 27, 2008 3:16 am
Reply with quote

Duplicate post. See thread ibmmainframes.com/viewtopic.php?t=34722
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 1
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top