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 

Insert date and time of run (timestamps) into records

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


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

PostPosted: Tue Dec 03, 2002 11:43 am    Post subject: Insert date and time of run (timestamps) into records Reply with quote

For information on how you can use the DATEn, DATEn(c), DATEnP, TIMEn, TIMEn(c) and TIMEnP options of DFSORT's INREC, OUTREC and OUTFIL OUTREC statements to insert timestamps into your output records, see the "How can I put timestamps in my output records?" Ask Professor Sort item at:

http://www.ibm.com/servers/storage/support/software/sort/mvs/professor_sort/
_________________
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


Last edited by Frank Yaeger on Fri Aug 25, 2006 4:01 pm; edited 2 times in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Venkata Ramana Reddy
Beginner


Joined: 02 Dec 2002
Posts: 70
Topics: 19
Location: California

PostPosted: Wed Feb 12, 2003 4:15 pm    Post subject: Reply with quote

Is it possible insert date timestamps into output records using SYNCSORT ?
_________________
Venkataramana
-- Good judgement comes from experience, and often experience comes from bad judgement.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Wed Feb 12, 2003 5:21 pm    Post subject: Reply with quote

Venkata ramana reddy,

Yes you can add the date and time into the output records using syncsort. Post the details of the output file i.e LRECL,RECFM, and the date & time format and position of the fields.

kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Venkata Ramana Reddy
Beginner


Joined: 02 Dec 2002
Posts: 70
Topics: 19
Location: California

PostPosted: Wed Feb 12, 2003 9:21 pm    Post subject: Reply with quote

Kolusu,
Here are the details you wanted :
Code:
 
LRECL          : 80
RECFM         : FB
Date Format : MMDDYY
Position        : 1 to 8


Awaiting for your early reply.....
_________________
Venkataramana
-- Good judgement comes from experience, and often experience comes from bad judgement.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Wed Feb 12, 2003 10:06 pm    Post subject: Reply with quote

venkata ramana reddy,

The following Jcl will give you the desired results.A brief explanation of the job.
The first copy operator gets the system date in MM/DD/CCYY format.The second copy operator takes this date and creates the control cards for the actual copy of the input DSN.The output from this copy would be as follows:

Code:

 OUTREC FIELDS=(C'02122003',1,72)


Now the 3rd copy uses that control card and creates the output with the current date in 1st postion followed by 72 bytes from the input file for a total length of 80 bytes.
Code:

//STEP0100 EXEC PGM=SYNCTOOL                               
//*                                                       
//TOOLMSG   DD SYSOUT=*                                   
//DFSMSG    DD SYSOUT=*                                   
//NULL      DD DUMMY,DCB=(LRECL=80,RECFM=FB,BLKSIZE=0)     
//DATE      DD DSN=&D,DISP=(,PASS),SPACE=(TRK,(1,1),RLSE) 
//IN        DD DSN=YOUR INPUT DSN,
//             DISP=SHR                                           
//CTL3OUT   DD DSN=YOUR OUTPUT DSN,
//             DISP=(NEW,CATLG,DELETE),
//             UNIT=SYSDA,
//             SPACE=(CYL,(X,Y),RLSE)
//TOOLIN    DD *                                           
  COPY FROM(NULL) USING(CTL1)                               
  COPY FROM(DATE) USING(CTL2)                               
  COPY FROM(IN)   USING(CTL3)                         
//CTL1CNTL  DD *                                         
  OUTFIL FNAMES=DATE,HEADER1=(DATE=(MD4/))                 
//CTL2CNTL  DD *                                           
  OUTFIL FNAMES=CTL3CNTL,                                 
  OUTREC=(C' OUTREC FIELDS=(C',        $ STRING OUTREC FIELDS=(C
          X'7D',                       $ OPENING QUOTE
          2,2,                         $ MONTH
          5,2,                         $ DAY
          8,4,                         $ YEAR
          X'7D',                       $ CLOSING QUOTE
          C',1,72)',                   $ COPY THE FIRST 72 FROM INPUT 
          80:X)                        $ PAD WITH SPACES
//CTL3CNTL  DD DSN=&T,DISP=(,PASS),SPACE=(TRK,(1,1),RLSE)
/*


Hope this helps...

cheers

kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


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

PostPosted: Thu Feb 13, 2003 1:10 pm    Post subject: Reply with quote

For the record, here's the easier way to do this with DFSORT (although the job above would work with DFSORT's ICETOOL as well):

Code:

//S1   EXEC  PGM=ICEMAN
//SYSOUT   DD  SYSOUT=*
//SORTIN   DD DSN=... input file
//SORTOUT  DD DSN=... output file
//SYSIN    DD    *
  OPTION COPY
* Generate current date in form C'yyyymmdd'
  INREC FIELDS=(DATE1,1,72)
* Rearrange date to C'mmddyyyy'
  OUTREC FIELDS=(5,4,1,4,9,72)
/*


To get the date as mmddyy instead of mmddyyyy, the OUTREC statement would be:

Code:

  OUTREC FIELDS=(5,4,3,2,9,72)

_________________
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
Venkata Ramana Reddy
Beginner


Joined: 02 Dec 2002
Posts: 70
Topics: 19
Location: California

PostPosted: Thu Feb 13, 2003 1:20 pm    Post subject: Reply with quote

Kolusu,
Thank you very much. Your solution worked.

Frank: I do not have DFSORT in our shop. We use SYNCSORT
_________________
Venkataramana
-- Good judgement comes from experience, and often experience comes from bad judgement.
Back to top
View user's profile Send private message
CaptBill
Beginner


Joined: 02 Dec 2002
Posts: 100
Topics: 2
Location: Pasadena, California, USA

PostPosted: Thu Feb 13, 2003 1:28 pm    Post subject: Reply with quote

Venkata Ramana Reddy,

What Frank is saying is he works for IBM and "wrote the book" on DFSORT. As a competive product, SYNCSORT belongs to another vendor. It would not be professional of him to tell you how to use a competitor's tool. And it could also cause legal and professional problems for him if he did.

Let me also add that when a DFSORT solution is presented, and you have SYNCSORT, just try it to see if it works. Oftentimes they do.

Disclaimer: I do not work for a software vendor and can make that suggestion.


Last edited by CaptBill on Thu Feb 13, 2003 2:37 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


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

PostPosted: Thu Feb 13, 2003 2:30 pm    Post subject: Reply with quote

Venkata,

Yes, I know you use Syncsort. I didn't give the DFSORT solution for you. I gave it for all of the DFSORT users who might do a search on this very often asked question and find this thread. That's why I said "for the 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
somuk
Beginner


Joined: 04 Feb 2003
Posts: 113
Topics: 37

PostPosted: Fri Jun 20, 2003 10:43 am    Post subject: Reply with quote

Kolusu,
Using the above method can we create a new file with the DSN as
AAAAAA.BBBBBB.Today's date (Eg: AAAAAA.BBBBBB.062003) using SYNSORT..?

Thanks
-Somu
_________________
Regds,
Somu
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 -> Utilities 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