View previous topic :: View next topic
|
Author |
Message |
Mukesh.py Currently Banned New User
Joined: 22 Sep 2008 Posts: 17 Location: Chennai, India.
|
|
|
|
Hi members.
How can we format data in a flat file using sort utility. we also need to split the output file. Also please give the solution if the split is not required.
Example:
Input file :
aaa 112b 4545
bbb 343f 6565
o/p file1
aaa 333g 4545
o/p file2
bbb 556h 6565
Thanks,
Mukesh. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
did You care to search the forum for hints ? |
|
Back to top |
|
|
ksk
Active User
Joined: 08 Jun 2006 Posts: 355 Location: New York
|
|
|
|
Mukesh,
Be clear about your requirement. What is the creteria to split the file? And what is the creteria to format the input data? On what basis you want to add "333g" or "556h"? |
|
Back to top |
|
|
Mukesh.py Currently Banned New User
Joined: 22 Sep 2008 Posts: 17 Location: Chennai, India.
|
|
|
|
Enrico. Yes i do cared to search the forum.
KSK.. seems i have clearly given my requirement in the form of input and output files. To make it clear to you. i want to replace that particular column value. u can take it as any column position say 12 to 18 . |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
Makesh,
Quote: |
Enrico. Yes i do cared to search the forum. |
It is a very basic requirement and if you had searched it you should have found it.
Anyways you can use the IF THEN OVERLAY to modify the data. And once then you can split that into two.
Between what sort product are you using? Search, code adn let us know if there are any issues.
P.S - Pls make use of the search facility as this would help u in understanding diff concepts. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
Quote: |
aaa 112b 4545
bbb 343f 6565
o/p file1
aaa 333g 4545
o/p file2
bbb 556h 6565
|
Quote: |
seems i have clearly given my requirement in the form of input and output files. |
what is the logic to transform the 112b in a 333g and 343f in 556h
if You are asked for clarification ,
You should meditate on the fact that Your requirements might not be as clear as You believe |
|
Back to top |
|
|
Mukesh.py Currently Banned New User
Joined: 22 Sep 2008 Posts: 17 Location: Chennai, India.
|
|
|
|
enrico.... we can assume it as need to format 10th to 15th column of a flat file.. Since i do not know much about how this will be achieved.. u cud help me out with ur own assumptions. if needed u can include conditions like assuming first 5 bytes are key fields or etc if required in the logic. |
|
Back to top |
|
|
Mukesh.py Currently Banned New User
Joined: 22 Sep 2008 Posts: 17 Location: Chennai, India.
|
|
|
|
aaru.. any sort utility will do... i want to know the concept of formating the fieild in a flat file. |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
Mukesh,
Aaru wrote:
Quote: |
you can use the IF THEN OVERLAY to modify the data |
Did you try searching for this keyword? |
|
Back to top |
|
|
Mukesh.py Currently Banned New User
Joined: 22 Sep 2008 Posts: 17 Location: Chennai, India.
|
|
|
|
Aaru.. Yes i got few code.. i will analyse.
Thanks. |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
Mukesh,
Quote: |
Aaru.. Yes i got few code.. i will analyse.
|
Thats great. Analyze, code and test.
Post if you face any problems. We are here to help. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
we can assume it as need to format 10th to 15th column of a flat file.. Since i do not know much about how this will be achieved.. u cud help me out with ur own assumptions. if needed u can include conditions like assuming first 5 bytes are key fields or etc if required in the logic. |
No, that's not the way it works. How you do different things with DFSORT depends on exactly what you want to do. If you want specific help, you need to give a specific situation. Show an example of your input records and what you want for output for all relevant variations. Give the "rules" for getting from input to output. Give the RECFM and LRECL of the input file and the starting position, length and format of all relevant fields.
If you want general information on how to do things, then you can reference the DFSORT books. If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:
Use [URL] BBCode for External Links
For complete information on all of the DFSORT functions, control statements and parameters, see "z/OS DFSORT Application Programming Guide" at the same URL.
The various DFSORT papers (e.g. Smart DFSORT Tricks) are also good reference material. All are available at:
www-304.ibm.com/systems/support/storage/software/sort/mvs/srtmprd.html |
|
Back to top |
|
|
|