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

Repeating input records for variable times depending on cond


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

New User


Joined: 30 Jun 2010
Posts: 85
Location: Toronto, ON

PostPosted: Fri Jul 31, 2015 4:16 pm
Reply with quote

Hi,

I have a requirement as below for which I would need a help on OUTIFIL REPEAT = n where n varies on a condition as stated below:

I/P : FB LREC L80

Record/date
a2015-01-01
b2015-01-02
c2015-01-03

O/P: FB LRECL 80

Records should be repeated based on the date difference no of times between the input date & current date:

For e.g if Current Date = 2015-01-03

Record/date
a2015-01-01
a2015-01-01
a2015-01-01
b2015-01-02
b2015-01-02
c2015-01-03

Date in the I/P file and O/P file would be at a fixed position.

Could you please suggest a possible way to conditionally repeat the records with OUTFIL REPEAT parameter or otherwise.

Regards,
sks
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: Fri Jul 31, 2015 4:47 pm
Reply with quote

You've been around long enough to know you should use the Code tags.

REPEAT works for each record in the OUTFIL group. The value cannot be changed.

You can use the slash-operator (/) with multiple IFTHEN=(WHEN=(logicalexpression). If you have lots of possible differences, then you can generate the code. If your differences may be huge, then you'll probably run out of space for the control cards and have to use a more general-purpose programming language (which is also possible right from the start).
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 TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
Search our Forums:

Back to Top