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

Help on arranging the records based on KEY value horizontaly


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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
Reply with quote

maybe one of these will help:

ibmmainframes.com/viewtopic.php?p=276780&highlight=horizontal#276780
ibmmainframes.com/viewtopic.php?p=264566&highlight=horizontal#264566
ibmmainframes.com/viewtopic.php?p=202778&highlight=horizontal#202778
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
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

Moderator Emeritus


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

PostPosted: Fri Sep 21, 2012 11:47 pm
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
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

Moderator Emeritus


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

PostPosted: Sat Sep 22, 2012 12:05 am
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

Moderator Emeritus


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

PostPosted: Sat Sep 22, 2012 12:09 am
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
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: 577
Location: USA

PostPosted: Sat Sep 22, 2012 12:26 am
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

Moderator Emeritus


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

PostPosted: Sat Sep 22, 2012 12:34 am
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: 1788
Location: Bloomington, IL

PostPosted: Sat Sep 22, 2012 12:41 am
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
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

Moderator Emeritus


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

PostPosted: Sat Sep 22, 2012 8:52 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Join multiple records using splice DFSORT/ICETOOL 5
No new posts EZT program to build a flat file with... All Other Mainframe Topics 9
No new posts JCL sortcard to print only the records DFSORT/ICETOOL 11
Search our Forums:

Back to Top