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
 

 

Help on arranging the records based on KEY value horizontaly

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
ravindra.vadali

New User


Joined: 30 Jan 2012
Posts: 34
Location: USA

PostPosted: Fri Sep 21, 2012 10:12 pm    Post subject: Help on arranging the records based on KEY value horizontaly
Reply with quote

Hi All,

I have a request to arrange records horizontaly based on key field, please find below the sample data:

Code:
Input file:
1 AAA
1 BBB
2 CCC
2 DDD
3 FFF
3 EEE
3 GGG
The out file should look like

Code:
1 AAA BBB
2 CCC DDD
3 FFF EEE GGG


Is it possible to attain this using a SORT/ICETOOL? if yes, then could you please share me the details

Thanks a many for the help
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Sep 21, 2012 10:25 pm    Post subject:
Reply with quote

maybe one of these will help:

http://ibmmainframes.com/viewtopic.php?p=276780&highlight=horizontal#276780
http://ibmmainframes.com/viewtopic.php?p=264566&highlight=horizontal#264566
http://ibmmainframes.com/viewtopic.php?p=202778&highlight=horizontal#202778
http://ibmmainframes.com/viewtopic.php?p=115457&highlight=horizontal#115457
Back to top
View user's profile Send private message
ravindra.vadali

New User


Joined: 30 Jan 2012
Posts: 34
Location: USA

PostPosted: Fri Sep 21, 2012 11:38 pm    Post subject:
Reply with quote

Hi Dick,

All these are useful but the clause is I don't know the exact no.of records for each instance. I mean for 1st instance it could be 10 and for the second it will be 5 and 3rd it could be 10 again so on...

All I could you use though is a key to group this. The key is the first 3 charecters of the record.

Thanks,
Ravi
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7241

PostPosted: Fri Sep 21, 2012 11:47 pm    Post subject: Reply to: Help on arranging the records based on KEY value h
Reply with quote

The first three characters are the key?

From your data, the first character is the key. Are you saying that it is really three digits, numeric?

Can you show your full, actual, requirement please?

Can you show the ICE201I message from one of your sort steps, so that we can see what level of the product you have?

Is your output file fixed or variable? What is the LRECL?
Back to top
View user's profile Send private message
ravindra.vadali

New User


Joined: 30 Jan 2012
Posts: 34
Location: USA

PostPosted: Fri Sep 21, 2012 11:56 pm    Post subject:
Reply with quote

Hi Bill,

Sorry, I have to take a step back. Actually the first position of each record is the key. The o/p file is a VB format.

Also, I ran a sample ICETOOL job in my shop and I don't see a ICE201I information but I could see WER* informations in the DFMSGs

Please correct me if I am missing anything.

Thanks,
Ravi
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Sat Sep 22, 2012 12:05 am    Post subject:
Reply with quote

Hello,

Your system is using Syncsort and your topic has been moved to the JCL part of the forum (where Syncsort is discussed).
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Sat Sep 22, 2012 12:09 am    Post subject:
Reply with quote

Hello,

What is the maximum 3-character values possible for a "key"?

Can there be duplicate values in the 3-character values within a key?

What is the recfm and lrecl of the 2 files?
Back to top
View user's profile Send private message
ravindra.vadali

New User


Joined: 30 Jan 2012
Posts: 34
Location: USA

PostPosted: Sat Sep 22, 2012 12:22 am    Post subject:
Reply with quote

Hi Dick,

The key field could be of duplicates. the recfm us VB and the lrecl for the i/p file is 120 and for the output it would be 480

THanks,
Ravi
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 578
Location: USA

PostPosted: Sat Sep 22, 2012 12:26 am    Post subject:
Reply with quote

ravindra.vadali wrote:
Hi Dick,

All these are useful but the clause is I don't know the exact no.of records for each instance. I mean for 1st instance it could be 10 and for the second it will be 5 and 3rd it could be 10 again so on...

All I could you use though is a key to group this. The key is the first 3 charecters of the record.

Thanks,
Ravi


If you don't know the exact no. of records for each instance, not even maximum, then no method will work for you.

Thanks,
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7241

PostPosted: Sat Sep 22, 2012 12:34 am    Post subject: Reply to: Help on arranging the records based on KEY value h
Reply with quote

Your input in LRECL 120, variable? But you are only showing five bytes of data? How does that add up?

An output of 480 allows for 119 three-char-plus space groupings plus the one character key, yes?
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1738
Location: Bloomington, IL

PostPosted: Sat Sep 22, 2012 12:41 am    Post subject: Re: Help on arranging the records based on KEY value horizon
Reply with quote

ravindra.vadali wrote:
I have a request to arrange records horizontaly based on key field [...] Is it possible to attain this using a SORT/ICETOOL?

I am curious: given that you purport to know C, COBOL, and PL/I, would it not have been quicker to dash off a quick program in one of those languages than to beg someone for Syncsort or Synctool control cards that you evidently can neither devise nor understand?
Back to top
View user's profile Send private message
ravindra.vadali

New User


Joined: 30 Jan 2012
Posts: 34
Location: USA

PostPosted: Sat Sep 22, 2012 1:10 am    Post subject:
Reply with quote

My apologies for the delayed response

@Akatsumi - yes, I am in the process of even writing a program.

@Bill - the data that I showed you was a mock up data, my query is still running in DB Visualizer so I am not having the actual data yet, once I have it I will share the same with you. Thanks for the help.

@SQLCODE1 - I agree, so the maximum no. of records for each instance would be 40.

Please let me know if I missed to address any of your queries and I will try to get the actual data as soon as possible. My query is kind of running out of resources so it may be a bit late for me to actually get exposed to the real data. But I promise to post the data as soon as I have it.

In the mean time, I request you not to bother much of my request (anyways I already proved myself what a jack I am icon_biggrin.gif ) until I have the real data and enjoy the weekend...

Once again my sincere thanks to each one of you for your valuable suggestions.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Sat Sep 22, 2012 8:52 am    Post subject:
Reply with quote

Hello,

When the input values for a key is more than 40 values, what should be done. The process needs to be terminated, a warning raised, or the "dropped" records need to be placed in a suspence file. Just eliminating records with no diagnostics will cause confusion/corruption.
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Unwrap the data based on delimiter X'25' bhavana yalavarthi DFSORT/ICETOOL 30 Fri Dec 09, 2016 10:25 am
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm


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