Comaprison of PS files with different records length(ICETOOL

In this Mainframe Forum - You can post your queries on DFSORT, ICETOOL , SyncSort & JCL Utilities

Moderators: Frank Yaeger, Moderator Group

Post Reply
Suchita
Member
Posts: 6
Joined: Fri Dec 02, 2011 2:45 pm

Comaprison of PS files with different records length(ICETOOL

Post by Suchita » Fri Dec 02, 2011 4:08 pm

Hi All,

I have following two files which I want to compare (using ICETOOL) on key field which occure on different position -

1) Input files:-
File 1 - PS,FB,113 record length (Key field - start at 64, 6 bytes)
File 2 - PS,FB,261 records length (Key field - start at 4, 6 bytes)

2) Output file:-
should be - PS,FB,261 record length

I want all key fields from File 1 which is not present in File 2
(i.e. non-matching records from File 1)

3) e.g

File 1 -
ASBDCF
AAABBB
DDDCCC

File 2 -
DDDCCC

Output File -
ASBDCF
AAABBB


4) I wrote following code by referring one of the post on this website, however I am getting return code 16.

Code: Select all

//S1 EXEC PGM=ICETOOL                                          
//TOOLMSG DD SYSOUT=*                                          
//DFSMSG DD SYSOUT=*                                           
//SYMNAMES DD *                                                
* CHANGE 64,6 TO POSITION AND LENGTH OF INPUT FILE1 KEY        
F1_KEY,64,6,CH                                                 
* CHANGE 4,6 TO POSITION AND LENGTH OF INPUT FILE2 KEY         
F2_KEY,4,6,CH                                                  
* CHANGE 113 TO LRECL OF INPUT FILE2                           
F1_RCD,1,113                                                   
F1_ID,*,2,CH                                                   
  F1_ID1,=,1,CH                                                
/*                                                             
//IN1 DD DISP=SHR,DSN=HCX.F40825.S00                           
//IN2 DD DSN=DEVDW06.F40897.S00,DISP=SHR                       
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(4,50)),DISP=(MOD,PASS)  
//OUT DD DSN=DEVDW06.F40002.SB193,                              
//             DSORG=PS,LRECL=261,RECFM=FB,                     
//            DISP=(NEW,CATLG,DELETE),                          
//            SPACE=(CYL,(4,50))                                
//TOOLIN DD *                                                   
COPY FROM(IN2) TO(T1) USING(CTL1)                               
COPY FROM(IN1) TO(T1) USING(CTL2)                               
SPLICE FROM(T1) TO(OUT) ON(F1_KEY) KEEPNODUPS KEEPBASE -        
  WITHALL WITH(F1_RCD) WITH(F1_ID1) USING(CTL3)                 
/*                                                              
//CTL1CNTL DD *                                                 
  INREC BUILD=(F1_KEY:F2_KEY,114:C'BB')                         
/*                                                              
//CTL2CNTL DD *                                                 
  INREC OVERLAY=(F1_ID1:C'VV')     
/*                                              
//CTL3CNTL DD *                                 
  OUTFIL FNAMES=OUT,INCLUDE=(F1_ID,EQ,C'VV'),   
    BUILD=(F1_RCD)                              
/*  



SPLICE OPERATION using CTL3 is RETURN CODE: 16

It seems I made mess with some RECL or keys field.

Please help. Thank you in advance.

Regards,
Suchita

DikDude
Moderator
Posts: 1001
Joined: Fri Jul 22, 2011 8:39 am
Location: usa

Post by DikDude » Fri Dec 02, 2011 10:56 pm

Diagnostic informaton was presented when this was run.

You need to post all of the diagnostic information including the message ids.
Have a good one

User avatar
Frank Yaeger
Moderator
Posts: 812
Joined: Sat Feb 18, 2006 5:45 am
Location: San Jose, CA
Contact:

Post by Frank Yaeger » Fri Dec 02, 2011 11:29 pm

Suchita,

It's easier to show you how to do it correctly then to figure out what you did wrong.
Here's a DFSORT JOINKEYS job that will do what you asked for:

Code: Select all

//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//IN1 DD DSN=...  input file1 (FB/113)
//IN2 DD DSN=...  input file2 (FB/261)
//SORTOUT DD DSN=...  ouput file (FB/113)
//SYSIN DD *
  JOINKEYS F1=IN1,FIELDS=(64,6,A)
  JOINKEYS F2=IN2,FIELDS=(4,6,A)
  JOIN UNPAIRED,F1,ONLY
  REFORMAT FIELDS=(F1:1,121)
  SORT FIELDS=(114,8,ZD,A)
  OUTREC BUILD=(1,113)
/*
//JNF1CNTL DD *
  INREC OVERLAY=(114:SEQNUM,8,ZD)
/*
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort

Suchita
Member
Posts: 6
Joined: Fri Dec 02, 2011 2:45 pm

Post by Suchita » Mon Dec 05, 2011 2:12 pm

Thank you for your replies.

Problem is resolved now!!

Thanks again.

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others