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

format data in a flat file using sort utility.


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Mukesh.py
Currently Banned

New User


Joined: 22 Sep 2008
Posts: 17
Location: Chennai, India.

PostPosted: Tue Nov 11, 2008 2:28 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Tue Nov 11, 2008 2:32 pm
Reply with quote

did You care to search the forum for hints ?
Back to top
View user's profile Send private message
ksk

Active User


Joined: 08 Jun 2006
Posts: 355
Location: New York

PostPosted: Tue Nov 11, 2008 2:35 pm
Reply with quote

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
View user's profile Send private message
Mukesh.py
Currently Banned

New User


Joined: 22 Sep 2008
Posts: 17
Location: Chennai, India.

PostPosted: Tue Nov 11, 2008 2:41 pm
Reply with quote

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
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Tue Nov 11, 2008 2:43 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Tue Nov 11, 2008 2:50 pm
Reply with quote

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
View user's profile Send private message
Mukesh.py
Currently Banned

New User


Joined: 22 Sep 2008
Posts: 17
Location: Chennai, India.

PostPosted: Tue Nov 11, 2008 2:57 pm
Reply with quote

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
View user's profile Send private message
Mukesh.py
Currently Banned

New User


Joined: 22 Sep 2008
Posts: 17
Location: Chennai, India.

PostPosted: Tue Nov 11, 2008 2:59 pm
Reply with quote

aaru.. any sort utility will do... i want to know the concept of formating the fieild in a flat file.
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Tue Nov 11, 2008 3:00 pm
Reply with quote

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
View user's profile Send private message
Mukesh.py
Currently Banned

New User


Joined: 22 Sep 2008
Posts: 17
Location: Chennai, India.

PostPosted: Tue Nov 11, 2008 3:06 pm
Reply with quote

Aaru.. Yes i got few code.. i will analyse.

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

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Tue Nov 11, 2008 3:16 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Nov 11, 2008 10:26 pm
Reply with quote

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
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Populate last day of the Month in MMD... SYNCSORT 2
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
Search our Forums:

Back to Top