View previous topic :: View next topic
|
Author |
Message |
ravindra.vadali
New User
Joined: 30 Jan 2012 Posts: 34 Location: USA
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
Back to top |
|
|
ravindra.vadali
New User
Joined: 30 Jan 2012 Posts: 34 Location: USA
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
ravindra.vadali
New User
Joined: 30 Jan 2012 Posts: 34 Location: USA
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
ravindra.vadali
New User
Joined: 30 Jan 2012 Posts: 34 Location: USA
|
|
|
|
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 |
|
|
sqlcode1
Active Member
Joined: 08 Apr 2010 Posts: 577 Location: USA
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
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 |
|
|
ravindra.vadali
New User
Joined: 30 Jan 2012 Posts: 34 Location: USA
|
|
|
|
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 ) 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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
|