Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
Yes, if you bound the fields which contain commas that you want to preserve with, for instance, quotes, then the commas will remain when imported into Excel (or elsewhere).
Code:
AAAAAAA,"BBBBB, B1B1B1, B2B22B2"
That, when imported, should get you two cells, the first containing AAAAAAA and the second BBBBB, B1B1B1, B2B22B2.
Try it - the PUSH=(134:1,8) will put bytes 1 to 8 from the BEGIN= record into bytes 134-141 of every record until the next record with non-blank in 1,8. The BEGIN= record gets the PUSH value, so will be included in output.
Garry.
One more doubt Garry, I want to send this final report in mail as CSV formatted Excel sheet but now what happens is, when I make this report with comma separated, the comma is added after every field in every row. The problem is the second field has BBBB,B1B1B1 and B2B2B2 for the group AAAAA but each comes one row making 3 rows. But how I wanted is to have a single row with first colum containing AAAAA and second column containing BBBBB
B1B1B1
B2B2B2
third column having CCCCC in a single row.
Can you please suggest me any idea on how can I do this. Is there any way....?
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
Is there a fixed number of rows for each key (e.g. 1,8 = AAAAAAAA )? If not, you'd probably be better processing the report in a program rather than in DFSORT.
There may be a way with sort - as well as starting each GROUP at a non-blank key, is there any way of determining the END of a group (e.g. 16,6,CH,EQ,C' ') ?
Is there a fixed number of rows for each key (e.g. 1,8 = AAAAAAAA )? If not, you'd probably be better processing the report in a program rather than in DFSORT.
There may be a way with sort - as well as starting each GROUP at a non-blank key, is there any way of determining the END of a group (e.g. 16,6,CH,EQ,C' ') ?
Garry.
yeah it is fixed. like the first field is the job name which is of 8 char and second will represent the in-condition which is of 8 chars, the third one will have 26 characters, like below:
Code:
jobabcde job78910 It is example one ALL
job12345 which shows job1
jobhhhhh jobeeeee It is example two ALL
which shows job2
so here I want like below in the excel sheet when mail
In the first row like below :
first column second column third column fourth column
jobabcde job78910 It is example one ALL
job12345 which shows job1
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
If there are only 2 records, I'd suggest you modify the PUSH. Instead of Pushing the key field (1,8) you can PUSH the entire first record at the end of both records.
Then you can drop the first record in JNF1CNTL output process. Finally, in the REFORMAT, you can use FIELDS=(F1:134,133,1,133) and you have the 2nd record appended to the first in a single 266-byte record.
DFSORT also has the ability to squeeze out blanks, left- and right-justify - which you might want to look at.
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
I think it would be much clearer if you now start a new question. You've got the output you want from your initial request, and it turns out that wasn't the whole thing.
A new question, then, with actual sample data and expected output, all in the Code tags to preserve spacing, and use the Preview button to see that you have what you want before posting.
I think it would be much clearer if you now start a new question. You've got the output you want from your initial request, and it turns out that wasn't the whole thing.
A new question, then, with actual sample data and expected output, all in the Code tags to preserve spacing, and use the Preview button to see that you have what you want before posting.