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
 

 

Pick the multiple recs for same condition.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Pick the multiple recs for same condition.
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: 2276
Location: @my desk

PostPosted: Thu Sep 10, 2009 5:58 pm    Post subject:
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    Post subject: Reply to: Pick the multiple recs for same condition.
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: 2276
Location: @my desk

PostPosted: Sun Jan 31, 2010 8:18 pm    Post subject:
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    Post subject: Reply to: Pick the multiple recs for same condition.
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    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
This topic is locked: you cannot edit posts or make replies. Need help on If condition continuatio... ashok_uddaraju CLIST & REXX 4 Fri May 19, 2017 8:55 am
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm
This topic is locked: you cannot edit posts or make replies. SDSF multiple spool datasets extracte... PJAlarcon CLIST & REXX 1 Fri Apr 21, 2017 10:50 pm
No new posts Validating file with multiple header/... mohitsaini DFSORT/ICETOOL 6 Thu Apr 13, 2017 1:53 am
No new posts Data replication from multiple Db2 ta... kishpra DB2 9 Mon Mar 27, 2017 9:58 pm


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