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
 

 

format data in a flat file using sort utility.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: format data in a flat file using sort utility.
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10231
Location: italy

PostPosted: Tue Nov 11, 2008 2:32 pm    Post subject: Reply to: format data in a flat file using sort utility.
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: 356
Location: New York

PostPosted: Tue Nov 11, 2008 2:35 pm    Post subject:
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    Post subject: RE
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: 1288
Location: Chennai, India

PostPosted: Tue Nov 11, 2008 2:43 pm    Post subject: Reply to: format data in a flat file using sort utility.
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10231
Location: italy

PostPosted: Tue Nov 11, 2008 2:50 pm    Post subject: Reply to: format data in a flat file using sort utility.
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    Post subject:
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    Post subject:
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: 1288
Location: Chennai, India

PostPosted: Tue Nov 11, 2008 3:00 pm    Post subject: Reply to: format data in a flat file using sort utility.
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    Post subject:
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: 1288
Location: Chennai, India

PostPosted: Tue Nov 11, 2008 3:16 pm    Post subject: Reply to: format data in a flat file using sort utility.
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 Moderator


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

PostPosted: Tue Nov 11, 2008 10:26 pm    Post subject:
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:

www.ibm.com/servers/storage/support/software/sort/mvs/srtmpub.html

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:

http://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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 1 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 2 Fri Mar 24, 2017 11:51 am
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts How to pick only YYMMDD from DATE1P (... atulbaviskar SYNCSORT 7 Wed Mar 22, 2017 11:39 am
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm


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