MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Reset Counter

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
arvibala
Beginner


Joined: 12 Feb 2008
Posts: 142
Topics: 67

PostPosted: Tue Sep 23, 2008 3:32 pm    Post subject: Reset Counter Reply with quote

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
View user's profile Send private message Yahoo Messenger
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Tue Sep 23, 2008 3:43 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
arvibala
Beginner


Joined: 12 Feb 2008
Posts: 142
Topics: 67

PostPosted: Wed Sep 24, 2008 7:43 am    Post subject: Reply with quote

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
View user's profile Send private message Yahoo Messenger
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Wed Sep 24, 2008 10:34 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
arvibala
Beginner


Joined: 12 Feb 2008
Posts: 142
Topics: 67

PostPosted: Wed Sep 24, 2008 12:23 pm    Post subject: Reply with quote

Thanks kolusu,

it helps
_________________
Arvind
"You can make a difference with your smile. Have that with you always"
Back to top
View user's profile Send private message Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group