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
 
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: 1932
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: 4650
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 Inefficient BUILD - VB records paddin... Daniel Prosser SYNCSORT 4 Thu Dec 14, 2017 3:52 pm
No new posts ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm
No new posts Merging 2 records at multiple rows wi... Bijesh DFSORT/ICETOOL 2 Wed Dec 06, 2017 1:50 am
No new posts Increment number for every group of r... srajendran2 DFSORT/ICETOOL 7 Thu Nov 09, 2017 10:31 pm
No new posts Matching and unmatched records!! Vignesh Sid SYNCSORT 3 Thu Nov 09, 2017 11:22 am

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