This is just an example but for my requirement there are so many field before the required field.
Is it possible that we can count commas in the record and then write after the count of commas
How many is "so many"? Is it more than 100? PARSE can handle 100 fields at a time.
You mention three fields, but your required output only shows two.
If you can get us some more detailed information...
Thanks Bill for the quick reply....
Yes my o/p will only contain two fields
I have around 24 fields in front of the required field , I have used ENDBEFR for such kind of requirement earlier
OUTREC PARSE=(%01=(ENDBEFR=C'¦',FIXLEN=12),
%02=(ENDBEFR=C'¦',FIXLEN=01),
%03=(ENDBEFR=C'¦',FIXLEN=02),
%04=(ENDBEFR=C'¦',FIXLEN=180),
%05=(ENDBEFR=C'¦',FIXLEN=30),
%06=(ENDBEFR=C'¦',FIXLEN=30),
%07=(ENDBEFR=C'¦',FIXLEN=30),
%08=(ENDBEFR=C'¦',FIXLEN=30),
%09=(ENDBEFR=C'¦',FIXLEN=30),
%10=(ENDBEFR=C'¦',FIXLEN=30),
%11=(ENDBEFR=C'¦',FIXLEN=30)),
but is it possible to achieve this by some other command or skipping few fields instead of extracting each
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
kamiya jain,
You can use DFSORT PARSE function to scan upto 100 fields. You can ignore the ones you don't need. Since your input is a VB file your actual data starts from position 5. Use the following DFSORT JCL which will create a VB file with the fields 2 and 4.
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
kamiya jain,
The reason your sort card did not work is you trying to overlay the RDW of the VB file. You canNOT overlay the contents of RDW. If you want an FB file then add the following statement. The 3 fields you interested are (12+18+18 =48 bytes)
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
Yes, it is possible.
Are you going with fixed positions/lengths for your output? Also are the chunks of record beyond the field length deliberate? Your output example from your first post wasn't clear on this.
If you can give your start positions and lengths, it'll help.
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
What do you mean by the sort card being too lengthy? It'll be as long as it needs to be, and needn't be longer. If that is in some way too long, then you'll have to look for another solution, maybe write a program.
Making the output dataset FB is not a problem.
I asked about the start positions and lengths of your output fields, as in what they are, rather than do you have them as a yes/no answer. You currently have "gaps" from the latest you have shown. Do you want those as well?
I means to say that sort card was too big...but I am coding that way only.
I used the above posted sort card and it worked fine..
Thank You so much for the help...
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
kamiya jain wrote:
I means to say that sort card was too big...but I am coding that way only.
I used the above posted sort card and it worked fine..
Thank You so much for the help...
Thanks for the feedback. Glad it's working.
The last line is for Kolusu, I've checked, I didn't post a line of code, and I still don't understand the "too big"/long thing, but there we go. :-)
Is there a way to use Parse and Build in SORT to include commas from the csv file? Using ENDBEFR = C'","' and fixed lengths copies data just before the comma. I have a requirement to split a csv file into two files. So fields 1 through 5 go on one file as it is while the remaining fields go on another file. I do not want to get rid of the commas or the enclosed double quotes. Appreciate any pointers please.
This is my first post, I'm sorry if I did not adhere to best practices related to posting but I'll be quick to adapt.
Is there a way to use Parse and Build in SORT to include commas from the csv file? Using ENDBEFR = C'","' and fixed lengths copies data just before the comma. I have a requirement to split a csv file into two files. So fields 1 through 5 go on one file as it is while the remaining fields go on another file. I do not want to get rid of the commas or the enclosed double quotes. Appreciate any pointers please.
This is my first post, I'm sorry if I did not adhere to best practices related to posting but I'll be quick to adapt.
Is there a way to use Parse and Build in SORT to include commas from the csv file? Using ENDBEFR = C'","' and fixed lengths copies data just before the comma. I have a requirement to split a csv file into two files. So fields 1 through 5 go on one file as it is while the remaining fields go on another file. I do not want to get rid of the commas or the enclosed double quotes. Appreciate any pointers please.
This is my first post, I'm sorry if I did not adhere to best practices related to posting but I'll be quick to adapt.
Thanks very much!
Welcome!
Next time , Please start a new post with your problem statement instead of tailgating any older posts as that's one of the rule and do search this forum before posting as it might have already been discussed before and you could use that solution.