The sequence repeats like the above .
I want the records to be extracted if I am given an account number
say, for acct no 27187481730348 I want the following records to be
extracted from the file
ABCDEF
Line1
Line2
ENGANVADK | 27187481730348 |
Line3
Line4
Line5
ABCDEF
More Details:
The acct number's position is fixed.
The file is VB . I do not know the length of any line .
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
Vijay Subramaniyan,
Do you have groups of records each starting with 'ABCDEF' and also ending with 'ABCDEF'?
Does the account number always have ENGANVADK at the beginning? What is the position and format of the account number? (include the RDW also as your input is VB file)
How many accounts are going to provide/pull at a time? Can you input your account numbers in a file like this ?
Yes. The group of records start with ABCDEF and end with ABCDEF. The account number will not have always ENGANVADK, but the
account number's position will be fixed . Assume its position is 15 and of 17 bytes long. I need to extract a group of records for an account number. Extracting one set of records may be enough for me.
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
The start and end indicators both being the same value was not a good idea. Is there anything else on those first and last records of the group to differentiate them from each other?
The actual problem lies in the fact that the account number is present in
the third line . Had it been in the first line , the task would have been much simpler by coding (WHEN=GROUP, PUSH ) statement .
Thank you much gcicchet . This would give me the group that the account number belongs to . Is there a way to do this without any manual intervention ?
We need to find out the group number to which the account number belongs to and then extract the records based on the group number . correct ? Would it not need two steps ?
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
Hello,
If the input has multiple account numbers and you want to extract the group of only one, how can this be done without specifying the account number "manually"
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
It's OK Dick - I had forgotten thaty he wanted to extract the details for a particular account. Yes there would have to be some sort of intervention, depending on how the acoount number is arrived at. Seems as though SYMNAMES is the candidate here.
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
Vijay Subramaniyan,
The following DFSORT/ICETOOL JCL will give you the desired results. I assumed the following.
1. Your account number to extracted starts in position 17 for a length of 14 bytes. This based on the sample input you provided. Your sample key starts at position 13, but your input is VB so the actual position of the field is 17 ( first 4 bytes is the RDW)
2. The Account number is always the 4th record from the header in a group and you atleast 1 record after the account number belonging to the same group.
The key you need to extract need to be passed via Parm using the JP1 format.