Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Comparing columns in same file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
kaleelahamed

New User


Joined: 08 Jun 2006
Posts: 45
Location: Trumbull, CT

PostPosted: Fri Aug 29, 2008 5:38 pm    Post subject: Comparing columns in same file
Reply with quote

Hi,

My Input File,
Code:
----+----1----+----2----+----3----+
G3A8420CFP478296..|G3A8420CFP478296
G3A8838FFS855437..?G3A3707FFS855437
G3G3835FFS595971...G3B4512FFS595971
G3!4512CC0W3000K..±G3B4512CC0W3000K
G3!4512CC0W3087K..±G3B4512CC0W3087K
G3!4512CC0W3320G..±G3B4512CC0W3320G
G3!4512CC0W3331G..±G3B4512CC0W3331G
G3B1013FFT161151...G3B2203FFT161151


Output File:
Code:
----+----1----+----2----+----3----+
G3A8420CFP478296..|G3A8420CFP478296
G3A8838FFS855437..?G3A3707FFS855437
G3B1013FFT161151...G3B2203FFT161151


In the output file created, it should not contain the records in which the 3rd AND 22nd COLUMN are different. Else the whole record should be copied in output file. The input file can have duplicates.

The input and output file LRECL is 35. The 3rd and 22nd position can hav special characters also.

Can this be done by DFSORT?

I believe we can get the output by using SPLICE option. Currently I am trying by level best to get the output using the SPLICE option in ICETOOL.

Can any one of please guide me to get the expected results?
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Fri Aug 29, 2008 6:45 pm    Post subject:
Reply with quote

I've assumed that the records are FB
Code:

//CONCAT   DD DSN=&&TEMP01,DISP=(MOD,PASS,DELETE),     
//            SPACE=(TRK,(10,10),RLSE),                 
//            RECFM=FB,LRECL=80                         
//CONCAT2  DD DSN=&&TEMP02,DISP=(MOD,PASS,DELETE),     
//            SPACE=(TRK,(10,10),RLSE),                 
//            RECFM=FB,LRECL=80                         
//OUT      DD SYSOUT=*                                 
//TOOLIN   DD *                                         
*                                                       
  COPY FROM(IN1) TO(CONCAT) USING(CPY1)                 
*                                                       
  COPY FROM(IN1) TO(CONCAT) USING(CPY2)                 
*                                                       
  SPLICE FROM(CONCAT) TO(CONCAT2) ON(37,1,CH) WITH(38,1)
*                                                       
  COPY FROM(CONCAT2)  TO(OUT) USING(CPY3)               
/*                                                     
//CPY1CNTL DD *                                         
  OUTREC BUILD(1,35,X,3,1)                             
/*                           
//CPY2CNTL DD *               
  OUTREC BUILD(1,35,X,22,1,X)
/*                           
//CPY3CNTL DD *               
  OUTREC BUILD(1,35)         

Result
Code:

G3!4512CC0W3000K..±G3B4512CC0W3000K
G3A8420CFP478296..|G3A8420CFP478296
G3B1013FFT161151...G3B2203FFT161151
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2285
Location: @my desk

PostPosted: Fri Aug 29, 2008 7:04 pm    Post subject:
Reply with quote

kaleelahamed,

The below SORT job does what you asked for.
Code:
//STEP1    EXEC PGM=ICEMAN                                 
//SYSOUT   DD SYSOUT=*                                     
//SORTOUT  DD SYSOUT=*                                     
//SORTIN   DD DSN=your.input.file....>FB,LRECL=35                                           
//SYSIN    DD *                                           
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(36:C'0')),             
        IFTHEN=(WHEN=(3,1,CH,NE,22,1,CH),OVERLAY=(36:C'1'))
  OPTION COPY                                             
  OUTFIL OMIT=(36,1,CH,EQ,C'1'),BUILD=(1,35)               

SORTOUT
Code:
G3A8420CFP478296..|G3A8420CFP478296
G3A8838FFS855437..?G3A3707FFS855437
G3B1013FFT161151...G3B2203FFT161151


expat,
The 3rd and 22nd characters in the first record of your output differ.

Thanks,
Arun
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Fri Aug 29, 2008 7:40 pm    Post subject: Reply to: Comparing columns in same file
Reply with quote

kaleelahamed,

It is a simple case of using an OMIT cond. expat and arcvns made it complicated. The following DFSORT JCL will give you the desired results
Code:

//STEP0100 EXEC PGM=ICEMAN             
//SYSOUT   DD SYSOUT=*                 
//SORTIN   DD *                       
G3A8420CFP478296..|G3A8420CFP478296   
G3A8838FFS855437..?G3A3707FFS855437   
G3G3835FFS595971...G3B4512FFS595971   
G3!4512CC0W3000K..±G3B4512CC0W3000K   
G3!4512CC0W3087K..±G3B4512CC0W3087K   
G3!4512CC0W3320G..±G3B4512CC0W3320G   
G3!4512CC0W3331G..±G3B4512CC0W3331G   
G3B1013FFT161151...G3B2203FFT161151   
//SORTOUT  DD SYSOUT=*                 
//SYSIN    DD *                       
  SORT FIELDS=COPY                     
  OMIT COND=(3,1,CH,NE,22,1,CH)       
/*


Hope this helps...

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

New User


Joined: 08 Jun 2006
Posts: 45
Location: Trumbull, CT

PostPosted: Mon Sep 01, 2008 10:55 am    Post subject: Reply to: Comparing columns in same file
Reply with quote

Thanks Skolusu!

The solution perfectly works....
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Mon Sep 01, 2008 1:47 pm    Post subject:
Reply with quote

Thanks are echoed. This is a new syntax for me.

Thank you.
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: Mon Sep 01, 2008 9:57 pm    Post subject:
Reply with quote

Quote:
This is a new syntax for me.


Really? This syntax has been part of DFSORT for decades. Perhaps you might want to go through "z/OS DFSORT: Getting Started" to see what else you're not aware of. You can find it at:

www.ibm.com/systems/support/storage/software/sort/mvs/srtmpub.html
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 Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 11 Fri Sep 22, 2017 11:35 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us