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

Syncsort - need to pick set of records.


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: Mon Sep 19, 2011 8:34 pm
Reply with quote

Hi, I need help of you experts here.........

I have got an input file (LRECL=80, RECFM=FB) with sets of records as given below:

Code:

----+----1----+----2----+----3
01XX8    XXXXX8GIMS   
02XX8    XXXXX813SALT 
14XX8    XXXXX811022051
15XX8    XXXXX831001102
99XX8    XXXXX8
01X18    XXXX18GIMS   
02X18    XXXX1823GILT 
99X18    XXXX18
01118    XXX118GIMS   
02118    XXX11813SALT 
14118    XXX11811022051
15118    XXX11831001102
99118    XXX118


I would like to copy 02, 14 and 15 records whenever the 02 has '13SALT' at 16th column.

Expected Output:
Code:

----+----1----+----2----+----3
02XX8    XXXXX813SALT 
14XX8    XXXXX811022051
15XX8    XXXXX831001102
02118    XXX11813SALT 
14118    XXX11811022051
15118    XXX11831001102


Please help.

Thanks.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Mon Sep 19, 2011 11:23 pm
Reply with quote

What if there is no 14 or 15 record but the 02 matches the criteria?
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Mon Sep 19, 2011 11:44 pm
Reply with quote

Off hand, I'd set up an IFTHEN= GROUP to group together all of the records that have '02' in the first two bytes, and PUSH the content of positions 16 through 21 to the end of the record.

Then, you can INCLUDE the records with '02', '14', or '15' in the first two bytes AND '13SALT' as the group.
Back to top
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Tue Sep 20, 2011 8:47 am
Reply with quote

Hi,

Thanks for the suggestion.........got the expected results.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Sep 20, 2011 7:19 pm
Reply with quote

Good to hear it is working - thank you for letting us know icon_smile.gif

If you post your solution, it will probably help someone else with a similar requirement one day.

d
Back to top
View user's profile Send private message
ramsri

Active User


Joined: 18 Oct 2008
Posts: 380
Location: India

PostPosted: Tue Sep 20, 2011 7:44 pm
Reply with quote

Yes Dick.........

Code:

INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,2,CH,EQ,C'02'),               
                         PUSH=(50:16,6))                       
SORT FIELDS=COPY                                                 
OUTFIL INCLUDE=((1,2,CH,EQ,C'02',AND,50,6,CH,EQ,C'13SALT'),OR, 
              (1,2,CH,EQ,C'14',AND,50,6,CH,EQ,C'13SALT'),OR,   
              (1,2,CH,EQ,C'15',AND,50,6,CH,EQ,C'13SALT'))                             


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 Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Join multiple records using splice DFSORT/ICETOOL 5
Search our Forums:

Back to Top