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
 
Copy set of records based on condition

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> SYNCSORT
View previous topic :: :: View next topic  
Author Message
krish.deepu

New User


Joined: 27 May 2014
Posts: 4
Location: India

PostPosted: Thu Mar 08, 2018 11:39 am    Post subject: Copy set of records based on condition
Reply with quote

Hello,

I've below requirement which I'm checking if it can be done via SORT.

There is a VB file/LRECL=504 which has around 8K records. It has a header and a trailer. The detailed records are grouped based on a 13 char long registration number. Under each registration number there can be multiple records which belongs to it. But the reg numbers will be always present in the record with first 10 chars as, say, XXXXXXXXXX. And its related records will immediately follow this record until next reg num record with XXXXXXXXXX is found.

So the detail rec will look something like below.
Code:

HEADER......
XXXXXXXXXXABC1234567890 CCYYMMDD etc  --> First reg num
UVVYY ABC1 DEF1 etc
UWWYYZ ABD3 DRREF1 etc
NNMMMZZ BCHH2 DEF1 etc
FFFWWYYZ SABD3 DRREF199 etc
XXXXXXXXXXDEF1357902468 CCYYMMDD etc  --> Second reg num
UVVYY ABC1 DEF1 etc
UWWYYZ ABD3 DRREF1 etc
NNMMMZZ BCHH2 DEF1 etc
FFFWWYYZ SABD3 DRREF099 etc
UVVYY ABC2 DEF5 etc
UWWYYZ ABD4 DRREF4 etc
NNMMMZZ BCHH5 DEF3 etc
FFFWWYYZ SABD6 DRREF299 etc
.
.
TRAILER.......


XXXXXXXXXX - identifies the rec where reg num is present. In above example ABC1234567890 has 4 detailed records and DEF1357902468 has 8.
Similary there will be many registration number with varying detailed records under each reg num.

I have a list of reg nums with me for which I want to copy out those reg num and its detailed records to another file. I just explained the example with one file. In real case, I've 100 files to deal with.

So could you please help me out to achieve this using sort. And if its not possible, any other efficient method by which I can achieve this.

Thanks a lot in advance.
Back to top
View user's profile Send private message

Arun Raj

Moderator


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

PostPosted: Fri Mar 09, 2018 12:43 am    Post subject:
Reply with quote

krish.deepu,

If there is a way to identify the reg num XXXXXXXXXX record in each group, use WHEN=GROUP and PUSH your reg num across each record in the group, then JOIN with your list of reg nums.
Back to top
View user's profile Send private message
krish.deepu

New User


Joined: 27 May 2014
Posts: 4
Location: India

PostPosted: Mon Mar 12, 2018 5:30 pm    Post subject:
Reply with quote

Thanks.. will try that out.
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 -> SYNCSORT All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Concatenaing multiple rows to single ... Vignesh Sid DFSORT/ICETOOL 1 Tue Aug 14, 2018 8:59 am
No new posts Add STAT condition Balu5491 Compuware & Other Tools 1 Mon Jul 30, 2018 7:32 pm
No new posts Copy records with unknown LRECL oerdgie DFSORT/ICETOOL 8 Tue Jul 24, 2018 7:50 pm
No new posts Need Help to Create 4 Output Records ... satish.ms10 DFSORT/ICETOOL 5 Thu Jul 19, 2018 1:55 am
No new posts Comparing Comp-3 fields with greater ... Prateeksichem1 DFSORT/ICETOOL 11 Fri Jul 13, 2018 8:45 am

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