IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Sort card to concatenate two records based on one condition


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Apr 23, 2015 11:57 pm
Reply with quote

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.
Back to top
View user's profile Send private message
sakrat

Active User


Joined: 05 Feb 2014
Posts: 164
Location: India

PostPosted: Fri Apr 24, 2015 3:38 pm
Reply with quote

Garry Carroll wrote:
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....?


Thanks,
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Fri Apr 24, 2015 3:52 pm
Reply with quote

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.
Back to top
View user's profile Send private message
sakrat

Active User


Joined: 05 Feb 2014
Posts: 164
Location: India

PostPosted: Fri Apr 24, 2015 4:15 pm
Reply with quote

Garry Carroll wrote:
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
Back to top
View user's profile Send private message
sakrat

Active User


Joined: 05 Feb 2014
Posts: 164
Location: India

PostPosted: Fri Apr 24, 2015 4:20 pm
Reply with quote

RahulG31 wrote:
Quote:
All the Rows corresponding to AAAAAAA in one row with BBBBB, B1B1B1, B2B22B2 all in one column

Do you mean BBBBB, B1B1B2, B2B2B2 under one column or inside one cell?

You can add a delimiter after every field so that they can be grouped under one column. May be a tab (X'05') or a comma (,)


under one cell in a column
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Fri Apr 24, 2015 4:25 pm
Reply with quote

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.

Garry.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Apr 24, 2015 4:25 pm
Reply with quote

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.
Back to top
View user's profile Send private message
sakrat

Active User


Joined: 05 Feb 2014
Posts: 164
Location: India

PostPosted: Fri Apr 24, 2015 4:27 pm
Reply with quote

Bill Woodger wrote:
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.



ok thanks.....
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL Goto page 1, 2  Next

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
Search our Forums:

Back to Top