Appending Yesterday's date to a file extension using JCL



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

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

Postby rajas.abcdefg » Sun Jul 12, 2009 1:58 am

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..
rajas.abcdefg
 
Posts: 38
Joined: Thu Jul 09, 2009 8:56 pm
Has thanked: 0 time
Been thanked: 0 time

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

Postby rajas.abcdefg » Mon Jul 13, 2009 1:04 am

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..
rajas.abcdefg
 
Posts: 38
Joined: Thu Jul 09, 2009 8:56 pm
Has thanked: 0 time
Been thanked: 0 time

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

Postby dick scherrer » Mon Jul 13, 2009 1:16 am

Hello,

We do not accept the same topic posted multiple times.

The duplicate has been removed.

d
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

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

Postby MrSpock » Mon Jul 13, 2009 6:00 pm

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?
User avatar
MrSpock
Global moderator
 
Posts: 809
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 4 times

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

Postby rajas.abcdefg » Sat Jul 18, 2009 7:55 pm

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???
rajas.abcdefg
 
Posts: 38
Joined: Thu Jul 09, 2009 8:56 pm
Has thanked: 0 time
Been thanked: 0 time

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

Postby MrSpock » Mon Jul 20, 2009 7:10 pm

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.
User avatar
MrSpock
Global moderator
 
Posts: 809
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 4 times

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

Postby rajas.abcdefg » Tue Jul 21, 2009 11:00 pm

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..
rajas.abcdefg
 
Posts: 38
Joined: Thu Jul 09, 2009 8:56 pm
Has thanked: 0 time
Been thanked: 0 time

Previous

Return to JCL

 


  • Related topics
    Replies
    Views
    Last post