Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Increment count till specific interval

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
shuklas

New User


Joined: 21 Dec 2006
Posts: 20
Location: London

PostPosted: Tue Jan 23, 2007 12:24 am    Post subject: Increment count till specific interval
Reply with quote

I have one input record and have to repeat this by incrementing the specific value for a particular interval and then start again if the interval is reached from the same start value.

First calumn will be incremented by one and for second column we have to increment value for a particular interval and then start again if that interval is reached from the initial value.

Example:

12345 123 ASD
12346 124 ASR
12347 125 ASR

12348 123 ASR
12349 124 ASR
12350 125 ASR

12351 123 ASR
12352 124 ASR
12353 125 ASR

How to achieve this using DFSORT.
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 Jan 23, 2007 12:48 am    Post subject:
Reply with quote

Your description is not clear. You say you have one input record - is that input record:

12345 123 ASD

or something else? Or do you actually have more than one input record?

If you have one input record, how many output records do you want to create? Do you want to add 1 to field1 for each input record? Do you want to add 1 to field2 for each input record until you have three records and then start over at the initial field2 value in your input record (123)? The first record you show has ASD whereas the other records have ASR. Where did ASR come from?

You need to explain more clearly what you want to do and show input and output records that correspond to that explanation.
Back to top
View user's profile Send private message
shuklas

New User


Joined: 21 Dec 2006
Posts: 20
Location: London

PostPosted: Tue Jan 23, 2007 12:57 am    Post subject:
Reply with quote

Hi Frank,
I just have one input record and that is
12345 123 ASD
what i want is to increment the value of column by 1 for all the output records and for column two i just want to increment till interval is reached
like in Example for second field has value.
123 124 125 and again 123 124 125 and so on.

The output third field is constant field it will remain unchanged.
Mistake from my side.
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 Jan 23, 2007 2:24 am    Post subject:
Reply with quote

You didn't say how many output records you want, so I'll assume it's 9 as shown in your example. Given that, here's a DFSORT job that will do what you asked for. You can change the INTVL symbol to whatever interval you want. I set it to +3 as in your example.

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SYMNAMES DD *
INTVL,+3
/*
//SORTIN DD DSN=...  input file (FB - one record)
//SORTOUT DD DSN=...  output file
//SYSIN    DD    *
  OPTION COPY
  OUTFIL REPEAT=9,
    IFTHEN=(WHEN=INIT,OVERLAY=(14:SEQNUM,5,ZD,START=0,
             19:14,5,ZD,MOD,INTVL,TO=ZD,LENGTH=3)),
    IFTHEN=(WHEN=INIT,BUILD=(1:1,5,ZD,ADD,14,5,ZD,TO=ZD,LENGTH=5,
     7:7,3,ZD,ADD,19,3,ZD,TO=ZD,LENGTH=3,11:11,3))
/*
Back to top
View user's profile Send private message
shuklas

New User


Joined: 21 Dec 2006
Posts: 20
Location: London

PostPosted: Tue Jan 23, 2007 4:45 pm    Post subject:
Reply with quote

Thanks Frank.
It worked fine and i am getting expected result.
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 How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
No new posts How to insert a value on specific pos... Poha Eater DFSORT/ICETOOL 9 Sun Oct 01, 2017 3:04 am
No new posts column with count of rows within dist... ronald wouterson DB2 4 Sun Sep 17, 2017 9:48 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm
No new posts SORT Trailer Count - LRECL Output co... amorante DFSORT/ICETOOL 5 Tue Aug 29, 2017 8:57 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us