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 

Logging when line shifts in DS ?

 
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
KM
Beginner


Joined: 22 Jul 2004
Posts: 18
Topics: 8

PostPosted: Thu Jun 09, 2005 8:47 am    Post subject: Logging when line shifts in DS ? Reply with quote

Here's the scenario:

I have a dataset: A. It contains multiple lines that are used as a reference in an application. Is it possible to write line (+ maybe timestamp) to another dataset, B, each time the line shifts ?
I cannot alter dataset A, so my options there are limited.

It should work something like this:

(DATASET A)

123
(Write dataset B)
1234
(Write dataset B)
12345
(Write dataset B)
123456
(Write dataset B)

Does it make sense or should I put this in the application itself ?

/KM
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Thu Jun 09, 2005 9:13 am    Post subject: Reply with quote

KM,

Let me get this straight. For every record in dataset A you need to write a new record with timestamp in another dataset B? If so it is very easy. Let us know about the format/layout of dataset B.

If my assumption is wrong then please elaborate?

Thanks

kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
KM
Beginner


Joined: 22 Jul 2004
Posts: 18
Topics: 8

PostPosted: Thu Jun 09, 2005 9:59 am    Post subject: Reply with quote

That is correct. It was kinda hard to explain the scenario, but yes the record i dataset A is 'used' for minutes, sometime even hrs, so when it shifts it would be nice to be able to see it somewhere (dataset B).
It would make sense to me to copy the line in dataset A and attach a timestamp to it in dataset B.
Both datasets have following attributes: RECFM=FB,LRECL=80.

Thanks for your help.

/KM
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Thu Jun 09, 2005 1:07 pm    Post subject: Reply with quote

Quote:

record in dataset A is 'used' for minutes, sometime even hrs, so when it shifts it would be nice to be able to see it somewhere (dataset B).


KM,

You mean to say that you have a pgm/online screen which reads the dataset A and does some processing which might take minutes or even hours? yikes !

So when it finishes the processing you want to write that record to another file with a timestamp that this record is processed on a particular date.

Quote:

It would make sense to me to copy the line in dataset A and attach a timestamp to it in dataset B.


If you want to just copy the dataset A to dataset B adding a timestamp , then the following JCL will give you the desired results.

Code:

//STEP0100  EXEC PGM=SORT
//SYSOUT    DD SYSOUT=*
//SORTIN    DD DSN=YOUR INPUT DATASET A,
//             DISP=SHR
//SORTOUT   DD DSN=YOUR INPUT DATASET B,
//             DISP=(NEW,CATLG,DELETE),
//             UNIT=SYSDA,
//             SPACE=(CYL,(X,Y),RLSE)
//SYSIN     DD *
  SORT FIELDS=COPY
  OUTREC FIELDS=(1,80,
                 DATE=(4MD-),C'-',TIME(24.),C'.',SEQNUM,6,ZD)
/*


Hope this helps...

Cheers

kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
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