Page 2 of 2

Re: Appending Yesterday's date to a file extension using JCL

PostPosted: Sun Jul 12, 2009 1:58 am
by rajas.abcdefg
Thanks Guru for your valuable comments.
But I need to acheive this using JCL (but without any cobol Program) :(

I got an idea but not sure how to exeute the same and its possibility. I think we can use sort card for date generaion , but I tried doing arithmetic in the "ourec build=(date1)"the same but it throwed be error, becoz of syntax error.

If we can generate yesterday's date into a data set, will this be possible to copy the characters to symbolic parameter??

Plz look into this


Thanks
Raj..

Re: Appending Yesterday's date to a file extension using JCL

PostPosted: Mon Jul 13, 2009 1:04 am
by rajas.abcdefg
Sorry Dick,

I missed to answer your query.

there is no restriction the way it is generated. We can generate using SQL or using sort card...


I had one more question can we get this using Rexx....if so can u help me with some sample JCL accompanied with JCl.. I am new to Rexx..

Re: Appending Yesterday's date to a file extension using JCL

PostPosted: Mon Jul 13, 2009 1:16 am
by dick scherrer
Hello,

We do not accept the same topic posted multiple times.

The duplicate has been removed.

d

Re: Appending Yesterday's date to a file extension using JCL

PostPosted: Mon Jul 13, 2009 6:00 pm
by MrSpock
OK. Let's go back from the top.

You can use a DFSORT job step to create the value for yesterday's date (current date - 1):

//STEP0001 EXEC PGM=ICEMAN             
//SORTIN   DD   *                     
                                       
/*                                     
//SORTOUT  DD   SYSOUT=*               
//SYSOUT   DD   SYSOUT=*               
//SYSIN    DD   *                     
  OPTION COPY                         
  INREC BUILD=(1:DATE1-1)             
  OUTFIL BUILD=(5,2,7,2,3,2,80:X)     
/*                                     


Now, we still haven't determined how and where you'll use that value. Are you going to build a new job to run after the current job, with the date supplied as a pre-determined variable? Will you write that date value into a member of a PDS and use it for subsequent jobs? Will you use it from within some sort of dynamic dataset allocation routine?

Re: Appending Yesterday's date to a file extension using JCL

PostPosted: Sat Jul 18, 2009 7:55 pm
by rajas.abcdefg
Hello MrSpock,

Thanks a lot for the above piece of code.. I will try and let u know if I am facing any issues..

Yes, using the above code, I will transer the required date to a dataset.

In another step,Will it be possible for me to read the value(above generated date) from the dataset and name my new dataset with the data???

Re: Appending Yesterday's date to a file extension using JCL

PostPosted: Mon Jul 20, 2009 7:10 pm
by MrSpock
The best option I can think of is to name and catalog the datasets using your site's normal naming conventions, and then use the new dataset names in an IDCAMS step to rename them.

Re: Appending Yesterday's date to a file extension using JCL

PostPosted: Tue Jul 21, 2009 11:00 pm
by rajas.abcdefg
Thanks MrSpock for the comments.

I had question about this. Does you mean to say to "rename" manually?? like set the values of date manually..