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
 

 

Help needed in DFSORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Help needed in DFSORT
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Wed Dec 07, 2011 3:15 pm    Post subject: Reply to: Help needed in DFSORT
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    Post subject: Help needed in DFSORT
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: 1491
Location: Chennai

PostPosted: Wed Dec 07, 2011 3:21 pm    Post subject:
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    Post subject: Help needed in DFSORT
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    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Wed Dec 07, 2011 3:55 pm    Post subject: Reply to: Help needed in DFSORT
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    Post subject: Re : Help needed in DFSORT
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    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
This topic is locked: you cannot edit posts or make replies. SORT trick needed bshkris SYNCSORT 6 Tue May 02, 2017 4:35 am
No new posts DFSORT - Overriding default option TU... Steve Ironmonger DFSORT/ICETOOL 3 Tue Apr 04, 2017 3:54 pm
No new posts DFSORT MUL FIELDS tspr52 DFSORT/ICETOOL 16 Fri Mar 03, 2017 11:53 pm
No new posts How to get the remainder and quotient... vnktrrd DFSORT/ICETOOL 2 Mon Oct 31, 2016 10:59 am
No new posts Change date (DD/MM/YY) in 2nd record ... uday kiran DFSORT/ICETOOL 12 Wed Sep 07, 2016 10:57 pm


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