Portal | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Sort card to concatenate two records based on one condition
Goto page Previous  1, 2
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Bill Woodger

Moderator Emeritus


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

PostPosted: Thu Apr 23, 2015 11:57 pm    Post subject: Reply to: Sort card to concatenate two records based on one condition
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    Post subject:
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: 1091
Location: Dublin, Ireland

PostPosted: Fri Apr 24, 2015 3:52 pm    Post subject:
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    Post subject:
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    Post subject: Re: Reply to: Sort card to concatenate two records based on one condition
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: 1091
Location: Dublin, Ireland

PostPosted: Fri Apr 24, 2015 4:25 pm    Post subject:
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: 7312
Location: Inside the Matrix

PostPosted: Fri Apr 24, 2015 4:25 pm    Post subject: Reply to: Sort card to concatenate two records based on one condition
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    Post subject: Re: Reply to: Sort card to concatenate two records based on one condition
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Copying data from prev record using SORT bshkris SYNCSORT 19 Thu Oct 15, 2020 3:29 pm
No new posts Converting Hex to PD Special Condition Rick Ryan SYNCSORT 3 Fri Oct 09, 2020 11:15 pm
No new posts Combining more 4 files with sorted or... bshkris DFSORT/ICETOOL 3 Thu Oct 08, 2020 10:57 am
No new posts JCL to extract repeating records saikarthik94 DFSORT/ICETOOL 6 Mon Oct 05, 2020 8:05 pm
This topic is locked: you cannot edit posts or make replies. Parsing more than 1000 columns in a s... ssuthagar SYNCSORT 10 Tue Sep 22, 2020 12:23 am

Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us