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
 

 

SPLICE OPERATOR for Pulling matching Field from Master File.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: SPLICE OPERATOR for Pulling matching Field from Master File.
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    Post subject: Reply to: SPLICE OPERATOR for Pulling matching Field from Ma
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:

www.ibm.com/systems/support/storage/software/sort/mvs/ugpf/


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    Post subject: Reply to: SPLICE OPERATOR for Pulling matching Field from Ma
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10291
Location: italy

PostPosted: Sat Sep 27, 2008 2:36 am    Post subject: Reply to: SPLICE OPERATOR for Pulling matching Field from Ma
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: 500
Location: USA

PostPosted: Sat Sep 27, 2008 3:16 am    Post subject: Reply to: SPLICE OPERATOR for Pulling matching Field from Ma
Reply with quote

Duplicate post. See thread http://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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Match two files using multiple keys a... santoshks1987 SYNCSORT 3 Fri Aug 18, 2017 10:50 am
No new posts Multiple VSAM files single output fil... Mohan Kothakota DFSORT/ICETOOL 11 Wed Aug 09, 2017 7:57 pm
This topic is locked: you cannot edit posts or make replies. rexx code to create a ps file Bharath Vikraman CLIST & REXX 4 Mon Aug 07, 2017 10:30 am
No new posts Split file based on comparsion to 2 f... Div Grad DFSORT/ICETOOL 3 Thu Jul 27, 2017 9:16 pm
No new posts Extra character appears in file when ... Balu5491 All Other Mainframe Topics 1 Wed Jul 26, 2017 2:39 pm


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