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 

Date in SYSIN

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


Joined: 27 Jan 2003
Posts: 41
Topics: 16

PostPosted: Mon Jan 12, 2004 4:56 pm    Post subject: Date in SYSIN Reply with quote

Hello,
My requirement is this;

I have a GDG MY.OUTPUT.FILE, I have to ftp this file as 'REPORT MMDDYY', where MMDDYY is the current date. How do I do this?? Please let me know.

Thanks
Puru
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: Mon Jan 12, 2004 6:04 pm    Post subject: Reply with quote

Puru,

The following DFSORT JCl will give you the desired results.I am assuming that you have the latest versions of DFSORT or syncsort. If you get an error running the job then let me know and I will post an alternate solution. A brief explanation of the job. we use the new date parm DATE1(CCYYMMDD) on inrec and later on format it according to our needs using outrec.

Just supply the name of the file to ftped and you will create a dynamic file name every time you run.

Code:

//STEP0100  EXEC  PGM=SORT                           
//SYSOUT    DD SYSOUT=*                               
//SORTIN    DD *                                     
PUT 'MY.OUTPUT.FILE(+0)'                             
//SORTOUT   DD DSN=YOUR FTP PARM LINE4,
//             DISP=(NEW,CATLG,DELETE),
//             UNIT=SYSDA,
//             SPACE=(TRK,(1,1),RLSE)                               
//SYSIN     DD *                                   
  SORT FIELDS=COPY                                     
  INREC FIELDS=(1,80,DATE1)                           
  OUTREC FIELDS=(1,40,5X,C'REPORT ',85,4,81,2,80:X)   
/*

The output of the above job is
Code:

PUT 'MY.OUTPUT.FILE(+0)'      REPORT 011220 


Now use the above created dataset to ftp the file. I have concatenated this file to the regular ftp parms like site addresss, userid...

Code:

//STEP0200 EXEC PGM=FTP,PARM='(EXIT=16'                           
//SYSPRINT DD SYSOUT=*                                           
//INPUT    DD *
YOUR FTP SITE ADDRESS
USERID PASSWORD
ROOT DIRECTORY OF THE FILE
//         DD DSN=YOUR FTP PARM LINE4,DISP=SHR
//         DD *
QUIT
//*


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


Joined: 27 Jan 2003
Posts: 41
Topics: 16

PostPosted: Mon Jan 12, 2004 6:21 pm    Post subject: Reply with quote

Kolusu,
Unfortunately I do not have the latest version of syncsort. It dos not recognise the DATE1 parameter. Could you please post the alternate solution?

Code:
 SYSIN :                                             
   SORT FIELDS=COPY                                 
   INREC FIELDS=(1,80,DATE1)                         
                      *                             
   OUTREC FIELDS=(1,40,5X,C'REPORT ',85,4,81,2,80:X)
 WER268A  INREC STATEMENT   : SYNTAX ERROR           
 WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000       


Thanks
Puru


Last edited by patnekar on Mon Jan 12, 2004 6:37 pm; edited 1 time in total
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: Mon Jan 12, 2004 6:36 pm    Post subject: Reply with quote

PURU,

Try this. I Did not have time to test it, so bear with me for any syntax errors.

Code:

//STEP0100  EXEC  PGM=SYNCTOOL
//TOOLMSG   DD SYSOUT=*                                         
//DFSMSG    DD SYSOUT=*                                         
//IN        DD *                                               
PUT 'MY.OUTPUT.FILE(+0)'                                       
//T1        DD DSN=&T1,DISP=(,PASS),SPACE=(TRK,(1,1),RLSE)
//OUT       DD DSN=YOUR FTP PARM LINE4,
//             DISP=(NEW,CATLG,DELETE),
//             UNIT=SYSDA,
//             SPACE=(TRK,(1,1),RLSE),       
//             RECFM=FB                               
//TOOLIN    DD *                                               
  COPY FROM(IN) USING(CTL1)                                     
  COPY FROM(T1) USING(CTL2)                                     
//CTL1CNTL  DD *                                               
  OUTFIL FNAMES=T1,NODETAIL,TRAILER1=(1,40,5X,DATE=(MD4/))       
//CTL2CNTL  DD *                                               
  OUTFIL FNAMES=OUT,OUTREC=(2,45,C'REPORT ',47,2,50,2,55,2,80:X)
//*


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


Joined: 27 Jan 2003
Posts: 41
Topics: 16

PostPosted: Mon Jan 12, 2004 6:39 pm    Post subject: Reply with quote

Kolusu,
Thanks a ton, it works great.

Thanks
Puru
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