View previous topic :: View next topic |
Author |
Message |
arvibala Beginner

Joined: 12 Feb 2008 Posts: 142 Topics: 67
|
Posted: Tue Sep 23, 2008 3:32 pm Post subject: Reset Counter |
|
|
Hi,
I have a Flat File where we maintain a counter. I need to reset the counter to ZEROES if it is greater than 100. This is a daily job and I need to execute this using a JCL. Can anyone help?
Thanks
Arvind B _________________ Arvind
"You can make a difference with your smile. Have that with you always" |
|
Back to top |
|
 |
Frank Yaeger Sort Forum Moderator

Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
|
Posted: Tue Sep 23, 2008 3:43 pm Post subject: |
|
|
How do you identify the record that contains the counter? What is the starting position, length and format of the counter in that record? _________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort |
|
Back to top |
|
 |
arvibala Beginner

Joined: 12 Feb 2008 Posts: 142 Topics: 67
|
Posted: Wed Sep 24, 2008 7:43 am Post subject: |
|
|
It Starts at position 15, length is 3 and its a numeric. Maybe in the below format.
XXXX XXXXXXXX 100 XXXXXX XXXXX XXXXXXXXXXX
I want to read the file and re-write into the same file.
Maybe you can suggest the utility, I can refer and get the logic so that I learn better.
Thanks, _________________ Arvind
"You can make a difference with your smile. Have that with you always" |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Wed Sep 24, 2008 10:34 am Post subject: |
|
|
arvibala,
Using the same input as output can cause problems. Use the following JCL. we first copy the input to a temp dataset making changes and then copy it back to the original input
Code: |
//STEP0100 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=YOUR INPUT FILE,
// DISP=SHR
//SORTOUT DD DSN=&T1,DISP=(,PASS),SPACE=(CYL,(1,1),RLSE)
//SYSIN DD *
SORT FIELDS=COPY
INREC IFTHEN=(WHEN=(15,3,ZD,GE,100),OVERLAY=(15:C'000'))
/*
//STEP0200 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=&T1,DISP=SHR
//SORTOUT DD DSN=YOUR INPUT FILE,
// DISP=OLD
//SYSIN DD *
SORT FIELDS=COPY
/* |
Hope this helps...
Cheers _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
arvibala Beginner

Joined: 12 Feb 2008 Posts: 142 Topics: 67
|
Posted: Wed Sep 24, 2008 12:23 pm Post subject: |
|
|
Thanks kolusu,
it helps _________________ Arvind
"You can make a difference with your smile. Have that with you always" |
|
Back to top |
|
 |
|
|