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

Help needed in DFSORT


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
vasanthavijayan

New User


Joined: 28 Sep 2010
Posts: 7
Location: Chennai

PostPosted: Wed Dec 07, 2011 3:11 pm
Reply with quote

I have a requirement like below.

Input File 1:

ABCD00001 12345.00
BBCD00002 52345.00
ABED00003 12445.60
ABCD00005 45.60
AXKD00008 6745.60

Output:

ABCD00001 12345.00
BBCD00002 52345.00
ABED00003 12445.60
ABCD00004 0
ABCD00005 45.60
ABCD00006 0
ABCD00007 0
AXKD00008 6745.60


The number of input records will vary. The maximum limit would be 99999. The first 9 bytes is alphanumeric.

Vasanth
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: Wed Dec 07, 2011 3:15 pm
Reply with quote

You mean you want to generate the "missing" keys with a zero value?

What's wrong with a simple little program to do it?
Back to top
View user's profile Send private message
vasanthavijayan

New User


Joined: 28 Sep 2010
Posts: 7
Location: Chennai

PostPosted: Wed Dec 07, 2011 3:21 pm
Reply with quote

Yes. I want the missing keys with zero.
I am just wondering is there any way to do it with sort.
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Wed Dec 07, 2011 3:21 pm
Reply with quote

Hi,
What is the logic behind the output records? A little more explanation would be helpful.
Do all the missing keys have ABCD as prefix?
Back to top
View user's profile Send private message
vasanthavijayan

New User


Joined: 28 Sep 2010
Posts: 7
Location: Chennai

PostPosted: Wed Dec 07, 2011 3:31 pm
Reply with quote

Quote:
What is the logic behind the output records?


The 5 bytes from position 5 will be sequence number for an index.

Quote:
Do all the missing keys have ABCD as prefix?


Yes
Back to top
View user's profile Send private message
kratos86

Active User


Joined: 17 Mar 2008
Posts: 148
Location: Anna NGR

PostPosted: Wed Dec 07, 2011 3:43 pm
Reply with quote

If you don't mind your output generated with the maximum limit of 99999. You can try something like this
Code:
//PGM   EXEC PGM=ICETOOL                             
//IN       DD *                                       
ABCD00001 12345.00                                   
BBCD00002 52345.00                                   
ABED00003 12445.60                                   
ABCD00005 45.60                                       
AXKD00008 6745.60                                     
//         DD *                                       
ABCD00001 0                                           
ABCD00002 0                                           
ABCD00003 0                                           
ABCD00004 0                                           
ABCD00005 0                                           
ABCD00006 0                                           
ABCD00007 0                                           
ABCD00008 0                                           
//OUT DD SYSOUT=*                                     
//TOOLMSG  DD SYSOUT=*                               
//DFSMSG   DD SYSOUT=*                               
//TOOLIN   DD *                                       
  SELECT FROM(IN) TO(OUT) ON(5,5,ZD) FIRST           

output -
Code:
ABCD00001 12345.00         
BBCD00002 52345.00         
ABED00003 12445.60         
ABCD00004 0               
ABCD00005 45.60           
ABCD00006 0               
ABCD00007 0               
AXKD00008 6745.60         
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: Wed Dec 07, 2011 3:55 pm
Reply with quote

And if you are worried about all that typing, you can get DFSORT to generate that dataset for you.
Back to top
View user's profile Send private message
vasanthavijayan

New User


Joined: 28 Sep 2010
Posts: 7
Location: Chennai

PostPosted: Wed Dec 07, 2011 3:55 pm
Reply with quote

Thanks kratos86

Is there any way to limit the output record to 8 for the above example?
The limit value will vary based on the input file.
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 Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts DFsort help with SUM() DFSORT/ICETOOL 12
No new posts Mainframe Programmer with CICS Skill... Mainframe Jobs 0
Search our Forums:

Back to Top