View previous topic :: View next topic
|
Author |
Message |
VivekKhanna
New User
Joined: 09 Feb 2009 Posts: 57 Location: India
|
|
|
|
Hi,
I had received a dataset (from FTP) and it contains some variable length records.
1. The problem is that I don't know about LRECL and MAXLEN of the records, that will be received. Then I need to process the information based on the delimiter provided (example below).
2. The second problem is that, the records may continue in the next line too (example below).
Key for reading the record is first 9 chars.
Code: |
111111111|ABCDXYZ|ABCS@ZYS.COM|ASDRG
111111112|ASVB|ASD@XYZ.COM!ASE
ASD
111111113|SDLKFHFD|ERIT@DFG.COM|SDDGF
111111114|SDFGDFG|DSKG@ERSDR.COM|SDFLKDG
DFGDHJSD
111111115|DFG|DFG@WER.COM|DFGDFGKJ
111111116|DFGDSFHGDF|SDFGHDFH@RITF.COM|DFGHFGH
111111117|DSFGSDG|SDFGDF@OIER.COM|SDFGDFSGH
|
I need the output to be FB and the output should be like:
Code: |
111111111|ABCDXYZ|ABCS@ZYS.COM|ASDRG
111111112|ASVB|ASD@XYZ.COM|ASEASD
111111113|SDLKFHFD|ERIT@DFG.COM|SDDGF
111111114|SDFGDFG|DSKG@ERSDR.COM|SDFLKDGDFGDHJSD
111111115|DFG|DFG@WER.COM|DFGDFGKJ
111111116|DFGDSFHGDF|SDFGHDFH@RITF.COM|DFGHFGH
111111117|DSFGSDG|SDFGDF@OIER.COM|SDFGDFSGH
|
The problem is that I don't know LRECL and MAXLEN of the record, and then convert VB into FB.
Please guide. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
You haven't given enough information for anyone to help you.
If you don't know the LRECL or MAXLEN of the record, how can we know the maximum number of delimited fields to expect? Or what the continued line can look like, or if there can be more than one continued line, or ...
You need to do a better job of defining what you're trying to do, what the data can look like, the maximum number of delimited fields per line, etc before anyone can help you. |
|
Back to top |
|
|
VivekKhanna
New User
Joined: 09 Feb 2009 Posts: 57 Location: India
|
|
|
|
Hi Frank,
Please consider the above mentioned data, as the complete one. If there are 4 fields in the input, then the record will look like
Code: |
111111111|ABCDXYZ|ABCS@ZYS.COM|ASDRG
|
The biggest problem is that, we are not sure, whether the information that has been sent is through FTP or copy-pasted like a notepad file. No information has been provided on the same. We are still trying to get this information like LRECL and MAXLEN of the record. But still, one of the biggest headache is the following type of record:
Code: |
111111114|SDFGDFG|DSKG@ERSDR.COM|SDFLKDG
DFGDHJSD
|
|
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
No information has been provided on the same. |
Until you have the specifications for the data how do you plan on implementing any solution. . . - sort or otherwise. . .
Suggest this be put on hold until someone can tell you the "rules".
Suggest also that some effort be put into correcting the creation of the file to be uploaded. |
|
Back to top |
|
|
VivekKhanna
New User
Joined: 09 Feb 2009 Posts: 57 Location: India
|
|
|
|
Thanks Dick.
I had already put up the queries to provide us with LRECL and MAXLEN. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
I agree with Dick. You are treating the symptoms and not the cause.
As stated by Dick
Quote: |
Suggest also that some effort be put into correcting the creation of the file to be uploaded. |
This would be the best solution. |
|
Back to top |
|
|
|