Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

To Merge mutliple records into a single record

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
anandgbe

New User


Joined: 03 Mar 2016
Posts: 10
Location: India

PostPosted: Wed Feb 22, 2017 8:49 am    Post subject: To Merge mutliple records into a single record
Reply with quote

I have some 1000 records in below format.

A1 Date1 Value1
A2 Date1 Value2
A3 Date1 value3
A5 Date1 value4
A1 Date2 Value5
A3 Date2 Value6
A4 Date2 value7
A5 Date2 value8
.
.
.
A1 Date31 value-v
A2 Date31 value-w
A3 Date31 value-x
A4 Date31 value-y
A5 Date31 value-z


I want to merge these records based on date value in the following format

Date1 Value1;value2;Value3; ;value4
Date2 value5; ;value6;value7;value8
.
.
.
Date31 value-v;value-w;value-x;value-y;value-z


Could you please suggest any algorithm to achieve this using JCL or REXX?

Thanks.
Back to top
View user's profile Send private message

Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1800
Location: UK

PostPosted: Wed Feb 22, 2017 2:35 pm    Post subject:
Reply with quote

Quote:
using JCL or REXX

so why post in the DFSort forum? DFSort is neither JCL or Rexx.
JCL cannot do what you want as it only tells the computer what programs you want to run and the resources required. If you are a programmer then you should be easily able to craft logic for doing this task in Rexx.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Thu Feb 23, 2017 12:01 am    Post subject: Reply to: To Merge mutliple records into a single record
Reply with quote

How do you decide where the "blank" column is in your example? (;;)

A maximum of five values per key? Or more?
Back to top
View user's profile Send private message
anandgbe

New User


Joined: 03 Mar 2016
Posts: 10
Location: India

PostPosted: Thu Feb 23, 2017 9:20 am    Post subject:
Reply with quote

Quote:
How do you decide where the "blank" column is in your example


If the A2 is unavailable for DATE1, then 2nd value should be empty(i.e. ; ;)

In second case, If the A4 id unavailable for DATE2, then 4the value field should be empty.


Quote:
A maximum of five values per key? Or more?


In my case, there will be maximum of 40 values for each key(i.e., for each Date field).

A1 Date1 Value1
A2 Date1 Value2
A3 Date1 value3
A5 Date1 value4 .
.
.
.
A40 Date1 valuex
A1 Date2 Value5
A3 Date2 Value6
A4 Date2 value7
A5 Date2 value8
.
.
.
A40 Date2 valuey
and so on till Date31.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2278
Location: @my desk

PostPosted: Thu Feb 23, 2017 8:49 pm    Post subject:
Reply with quote

Should your output look like this, for the given example?
Code:
Date1 Value1;value2;Value3; ;value4; ; ; ; ; ;.....upto 40 entries
Date2 value5; ;value6;value7;value8; ; ; ; ; ;.....upto 40 entries
Back to top
View user's profile Send private message
anandgbe

New User


Joined: 03 Mar 2016
Posts: 10
Location: India

PostPosted: Fri Mar 10, 2017 12:20 pm    Post subject:
Reply with quote

Quote:

Should your output look like this, for the given example?


Yes Arunraj, I need exactly in the same format as you mentioned.
Back to top
View user's profile Send private message
sergeyken

New User


Joined: 29 Apr 2008
Posts: 91
Location: Maryland

PostPosted: Sun Mar 12, 2017 1:37 am    Post subject: Re: To Merge mutliple records into a single record
Reply with quote

anandgbe wrote:

Could you please suggest any algorithm to achieve this using JCL or REXX?


Your major problem is: full misunderstanding of the issue, and terminology.

The ALGORITHM is a sort of some abstract description of the process required to achieve the goal. It has absolutely nothing to do with any "language", neither JCL, nor REXX, nor anything else. (BTW, JCL itself cannot be used for these purposes; but utilities like SYNCSORT called from JCL can be used).

When prepared, the algorithm can be IMPLEMENTED using almost any available tool, or programming language.

Since you have demonstrated absolutely no understanding of the task at this level, any advice or explanation "in-general" would be useless. I refuse to provide you with final ready-to-use solution. First of all, RTFM.
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
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Need to write record of PS File in ex... Chandan1993 JCL & VSAM 1 Wed Jun 07, 2017 1:35 am
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
This topic is locked: you cannot edit posts or make replies. SDSF multiple spool datasets extracte... PJAlarcon CLIST & REXX 1 Fri Apr 21, 2017 10:50 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us