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: 2429
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
This topic is locked: you cannot edit posts or make replies. DFSORT output in CSV for data spans i... hiravibk DFSORT/ICETOOL 3 Tue Nov 13, 2018 7:55 pm
No new posts Process Last Key of a record based on... naveen katkuri DFSORT/ICETOOL 5 Mon Nov 12, 2018 9:54 am
No new posts Writing multiple records into a CSV r... hiravibk DFSORT/ICETOOL 2 Wed Nov 07, 2018 2:35 pm
No new posts Can records in IMS/DB be related usin... SRICOBSAS IMS DB/DC 2 Fri Oct 19, 2018 3:53 pm
No new posts Anyone know how to copy Unix files? John Poulakos JCL & VSAM 7 Wed Oct 10, 2018 12:57 am

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