Page 1 of 1

Syncsort - Copy Record until a condition met !

PostPosted: Tue Nov 25, 2008 7:42 pm
by ranga_subham
Hi,

How to copy records from an input file until some condition is met? Here I want to copy records till "ERROR - PROCESS CLOSED" is occured.

Input Data:

ERROR - PROCESS CLOSED
RET0 13 001 XXX48   001 N
RET2 13 001 XXY48   002 T
RET9 13 001 XXZ48   001 T
RET8 13 001 XBX48   002 N
RET9 13 001 XYT48   003 N
ERROR - PROCESS CLOSED
RET1 83 001 XXX48   001 N
RET5 83 001 XXY48   002 T
RET7 83 001 XXZ48   001 T
ERROR - PROCESS CLOSED
RET2 10 001 XXX48   001 N
RET6 10 001 XXY48   002 T
RET1 10 001 XBX48   002 N
RET2 10 001 XYT48   003 N


I want to create three files out of it.

File-1:

ERROR - PROCESS CLOSED
RET0 13 001 XXX48   001 N
RET2 13 001 XXY48   002 T
RET9 13 001 XXZ48   001 T
RET8 13 001 XBX48   002 N
RET9 13 001 XYT48   003 N


File-2:

ERROR - PROCESS CLOSED
RET1 83 001 XXX48   001 N
RET5 83 001 XXY48   002 T
RET7 83 001 XXZ48   001 T


File-3:

ERROR - PROCESS CLOSED
RET2 10 001 XXX48   001 N
RET6 10 001 XXY48   002 T
RET1 10 001 XBX48   002 N
RET2 10 001 XYT48   003 N


Please help.

Thanks.

Re: Syncsort - Copy Record until a condition met !

PostPosted: Wed Nov 26, 2008 2:18 am
by dick scherrer
Hello,

Will the file always have exactly 3?

What should happen if there are less or more than 3?

Re: Syncsort - Copy Record until a condition met !

PostPosted: Wed Nov 26, 2008 3:52 pm
by ranga_subham
I copy pasted only few from input file as a sample. The file will have not less than 20,000 for any given day.

Thanks.

Re: Syncsort - Copy Record until a condition met !

PostPosted: Wed Nov 26, 2008 10:37 pm
by dick scherrer
Hello,

You cannot create 20,000 files in a run. . .

It is probably time to look for a different approach to the requirement.

Re: Syncsort - Copy Record until a condition met !

PostPosted: Wed Nov 26, 2008 11:21 pm
by Alissa Margulies
I agree with Dick.

Re: Syncsort - Copy Record until a condition met !

PostPosted: Thu Nov 27, 2008 3:14 pm
by ranga_subham
Guys, sorry if I have caused any confusion to you !!

The total number of records would be 20,000, I said. :oops: Not the no. of files to be 20,000.......that will be too huge to create with any approach :mrgreen:
The trend of the file has had header records (ERROR - PROCESS CLOSED) anywhere between 15 to 20 at the maximum followed by their detailed records. All put together will form total of 20,000 records. :roll:

Please let me know the approach.

Thank you.

Re: Syncsort - Copy Record until a condition met !

PostPosted: Mon Apr 21, 2014 10:17 pm
by chandu_rck
Hi,
I am looking for answer to the similar question. Is anyone able to answer this? Appreciate your help in advance.

Thanks
Chandrakanth.

Re: Syncsort - Copy Record until a condition met !

PostPosted: Mon Apr 21, 2014 10:20 pm
by BillyBoyo
You'll need to ask a new question.

Re: Syncsort - Copy Record until a condition met !

PostPosted: Mon Apr 21, 2014 10:24 pm
by dick scherrer
Hello and welcome to the forum,

You need to start a new topic for your question and provide all of the info we will need to help.

Show some sample input and the output you want when this new process is run. Mention the recfm and lrecl of the files and any processing "rules" that need to be followed.