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

Pick the multiple recs for same condition.


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

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Sat Sep 05, 2009 11:14 pm
Reply with quote

Hi, My file (RECFM=FB, LRECL=80) looks as given below:

Code:

----+----1----+----2----+----3----+----4
01XX1    ABCXX1KYOCERA
02XX1    ABCXX1DOOMS
06XX1    ABCXX11050ARUSH6000
06XX1    ABCXX11050PURSH5500
14XX1    ABCXX1ONETWOTHREE
15XX1    ABCXX1FOURFIVESIX
99XX1    ABCXX1END
01XX1    BBCXX1KYOCERB
02XX1    BBCXX1DOOMT
06XX1    BBCXX11050BRUSH4000
14XX1    BBCXX1ONETWOTHREE
15XX1    BBCXX1FOURFIVESIX
99XX1    BBCXX1END
01XX1    TBCXX1KYOCERC
02XX1    TBCXX1DOOML
06XX1    TBCXX11050ARUSI1000
14XX1    TBCXX1ONETWOTHREE
15XX1    TBCXX1FOURFIVESIX
99XX1    TBCXX1END
01XXZ    ABCXXZKYOCERZ
02XXZ    ABCXXZPOOMS
06XXZ    ABCXXZ1050CRUSH2000
06XXZ    ABCXXZ1050PIRSH4500
06XXZ    ABCXXZ1050PIRSV4100
09XXZ    ABCXXZERROR
14XXZ    ABCXXZONETWOTHREE
15XXZ    ABCXXZFOURFIVESIX
99XXZ    ABCXXZEND


I want copy only those set of records (01 to 99) that have multiple '1050' appearing starting at 16th position (set of records having more than one '06' type records). The output should be as given below:

Code:

01XX1    ABCXX1KYOCERA
02XX1    ABCXX1DOOMS
06XX1    ABCXX11050ARUSH6000
06XX1    ABCXX11050PURSH5500
14XX1    ABCXX1ONETWOTHREE
15XX1    ABCXX1FOURFIVESIX
99XX1    ABCXX1END
01XXZ    ABCXXZKYOCERZ
02XXZ    ABCXXZPOOMS
06XXZ    ABCXXZ1050CRUSH2000
06XXZ    ABCXXZ1050PIRSH4500
06XXZ    ABCXXZ1050PIRSV4100
09XXZ    ABCXXZERROR
14XXZ    ABCXXZONETWOTHREE
15XXZ    ABCXXZFOURFIVESIX
99XXZ    ABCXXZEND


Please help.

Thanks.
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Thu Sep 10, 2009 5:58 pm
Reply with quote

Hello,

The below SyncSort job should do what you asked.
Code:
//STEP0100 EXEC PGM=SORT                                             
//SYSOUT   DD SYSOUT=*                                               
//SORTIN   DD DSN= Input file (FB/LRECL=80)                         
//T1       DD DSN=&&T1,DISP=(,PASS),UNIT=SYSDA                       
//T2       DD DSN=&&T2,DISP=(,PASS),UNIT=SYSDA                       
//SYSIN    DD *                                                     
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,8,ZD)),                 
        IFTHEN=(WHEN=(1,2,CH,EQ,C'01'),                             
        OVERLAY=(81:SEQNUM,8,ZD)),                                   
        IFTHEN=(WHEN=NONE,                                           
        OVERLAY=(89:SEQNUM,8,ZD,81:81,8,ZD,SUB,89,8,ZD,M11,LENGTH=8))
  SORT FIELDS=COPY                                                   
  OUTREC OVERLAY=(97:SEQNUM,8,ZD)                                   
  OUTFIL FNAMES=T1,BUILD=(1,88)                                     
  OUTFIL FNAMES=T2,INCLUDE=(1,2,CH,EQ,C'06'),                       
                   BUILD=(1,88,SEQNUM,8,ZD,RESTART=(81,8))           
//STEP0200 EXEC PGM=SORT                                       
//SYSOUT   DD SYSOUT=*                                         
//SORTOUT  DD DSN= Output file (FB/LRECL=80)                   
//SORTJNF1 DD DSN=&&T1,DISP=(OLD,PASS),UNIT=SYSDA               
//SORTJNF2 DD DSN=&&T2,DISP=(OLD,PASS),UNIT=SYSDA               
//SYSIN    DD *                                                 
  JOINKEYS FILE=F1,FIELDS=(81,8,A),SORTED                       
  JOINKEYS FILE=F2,FIELDS=(81,8,A),SORTED,INCLUDE=(89,8,ZD,EQ,2)
  REFORMAT FIELDS=(F1:1,80)                                     
  SORT FIELDS=COPY                                             
Back to top
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Sun Jan 24, 2010 10:22 pm
Reply with quote

Hi,

It has worked. I am just curious to know if any single step solution were possible with Syncsort v1.3.2.

Thanks a lot.
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Sun Jan 31, 2010 8:18 pm
Reply with quote

Ramsri,

I was away for a couple of months. Has your shop upgraded to SyncSort 1.3.2?? I'll give a try once I get back to work again. But I wonder why it took almost 5 months for you to test it out!! icon_smile.gif
Back to top
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Mon Feb 08, 2010 12:02 pm
Reply with quote

Hi, Arun.

We are at Syncsort v1.3.2. I almost forgot this topic but luckily hit it againt recently as I did some dig up.

Thanks.
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 INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Multiple table unload using INZUTILB DB2 2
No new posts Grouping by multiple headers DFSORT/ICETOOL 7
No new posts How to append a PS file into multiple... JCL & VSAM 3
Search our Forums:

Back to Top