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
 

 

Syncsort - need to pick set of records.

 
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: Mon Sep 19, 2011 8:34 pm    Post subject: Syncsort - need to pick set of records.
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: 1722
Location: UK

PostPosted: Mon Sep 19, 2011 11:23 pm    Post subject:
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

Moderator Team Head


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

PostPosted: Mon Sep 19, 2011 11:44 pm    Post subject: Reply to: Syncsort - need to pick set of records.
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    Post subject: Reply to: Syncsort - need to pick set of records.
Reply with quote

Hi,

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

Site Director


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

PostPosted: Tue Sep 20, 2011 7:19 pm    Post subject: Reply to: Syncsort - need to pick set of records.
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    Post subject: Reply to: Syncsort - need to pick set of records.
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    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
No new posts Sort Card to Remove Duplicate records... raj4neo SYNCSORT 2 Wed Jan 25, 2017 4:44 am
No new posts SYNCSORT SEQNUM and FI fields. nartcr SYNCSORT 6 Sat Jan 21, 2017 4:02 am
No new posts Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am


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