Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Attach current-date to output file-name ?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Sysaron

New User


Joined: 28 Sep 2005
Posts: 49
Location: USA

PostPosted: Tue Nov 23, 2010 11:42 pm    Post subject: Attach current-date to output file-name ?
Reply with quote

Hello there,

I did scan the questions and could not find the answer.

Is it possible for DFSORT or ICETOOL to make a copy of a file and attach the current date as the last name in the file. Such as this:


Input: my.file.data
Output: my.file.data.20101123 <---- today's date yyymmdd

Thank you so much in advance.
Sharon in L.A.
Back to top
View user's profile Send private message

Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Tue Nov 23, 2010 11:52 pm    Post subject: Re: Attach current-date to output file-name ?
Reply with quote

Sysaron wrote:
Hello there,

I did scan the questions and could not find the answer.

Is it possible for DFSORT or ICETOOL to make a copy of a file and attach the current date as the last name in the file. Such as this:


Input: my.file.data
Output: my.file.data.20101123 <---- today's date yyymmdd

Thank you so much in advance.
Sharon in L.A.


Your output file name would not be a valid MVS file name.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1738
Location: Bloomington, IL

PostPosted: Tue Nov 23, 2010 11:54 pm    Post subject:
Reply with quote

The name you give as an example would be an invalid DSN. Moreover, I hardly think that DFSORT would be the tool of choice for setting the DSN (although I will defer to Messrs. Yaeger and Kolusu on this). I would recommend creating IDCAMS control cards (that could be done by DFSORT) or modifying the JCL with a bit of Rexx prior to submission.

The consensus in these fora seems to be that the inclusion of the creation date of a data set in its name is at best a dubious practice; you may wish to contemplate whether a GDG might be used instead.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Nov 24, 2010 12:58 am    Post subject:
Reply with quote

Hello,

And the question is not really related to SORT. . .

Once you have decided on what to use as a valid dataset name, there are multiple topics in the forum about generating a dataset name/node rather than having it hardcoded.
Back to top
View user's profile Send private message
Sysaron

New User


Joined: 28 Sep 2005
Posts: 49
Location: USA

PostPosted: Wed Nov 24, 2010 2:45 am    Post subject:
Reply with quote

Hi there,

I will give a valid name:

SYSHR.D112310.DATA

----- .Dmmddyy.------

I hope someone can help. The customers rejected using GDGs.

Thanks so much.
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Wed Nov 24, 2010 3:34 am    Post subject: Reply to: Attach current-date to output file-name ?
Reply with quote

sysaron,

The following DFSORT JCL will give you the desired results. Once you have verified the jcl created is good, change the statement
Code:

//SORTOUT   DD SYSOUT=*

to
Code:

//SORTOUT   DD SYSOUT=(*,INTRDR) 


Code:

//STEP0100 EXEC PGM=SORT                                               
//SYSOUT    DD SYSOUT=*                                                 
//SORTIN    DD *                                                       
DUMMY RECORD                                                           
//SORTOUT   DD SYSOUT=*                                                 
//SYSIN     DD *                                                       
  SORT FIELDS=COPY                                                     
  INREC FIELDS=(DATE1)                                                 
  OUTFIL OUTREC=(C'//USERIDZ JOB ',X'7D',C'CREATE DSN',X'7D',           
                 C',CLASS=A,',/,                                       
                 C'//',13X,C'MSGCLASS=Y,MSGLEVEL=(1,1),',/,             
                 C'//',13X,C'NOTIFY=&SYSUID',/,                         
                 C'//*',/,                                             
                 C'//STEP0100 EXEC PGM=IEFBR14',/,                     
                 C'//FILE1    DD DSN=SYSHR.D',5,4,3,2,C'.DATA,',/,     
                 C'//            DISP=(NEW,CATLG,DELETE),',/,           
                 C'//            UNIT=SYSDA,',/,                       
                 C'//            SPACE=(CYL,(X,Y),RLSE),',/,         
                 C'//            DCB=(LRECL=NNN,RECFM=FB,BLKSIZE=0)',/,
                 C'//*',80:X)                                           
//*


This will create a JCL which looks like this

Code:

//USERIDZ JOB 'CREATE DSN',CLASS=A,                   
//             MSGCLASS=Y,MSGLEVEL=(1,1),             
//             NOTIFY=&SYSUID                         
//*                                                   
//STEP0100 EXEC PGM=IEFBR14                           
//FILE1    DD DSN=SYSHR.D112310.DATA,                 
//            DISP=(NEW,CATLG,DELETE),                 
//            UNIT=SYSDA,                             
//            SPACE=(CYL,(X,Y),RLSE),               
//            DCB=(LRECL=NNN,RECFM=FB,BLKSIZE=0)       
//*                                                   


Alternatively you can generate the same using EZACFSM1
Back to top
View user's profile Send private message
Sysaron

New User


Joined: 28 Sep 2005
Posts: 49
Location: USA

PostPosted: Wed Nov 24, 2010 3:49 am    Post subject:
Reply with quote

Thank you so much Skolusu !!!
That is a very cool and easy way to create JCL.
Your time and expertise is Much Appreciated.
Back to top
View user's profile Send private message
Subhadeep Manna

New User


Joined: 18 Oct 2010
Posts: 2
Location: India

PostPosted: Wed Nov 24, 2010 2:13 pm    Post subject:
Reply with quote

Hi Skolusu
Please explain how the following statement works to provide the current date identifier
C'//FILE1 DD DSN=SYSHR.D',5,4,3,2,C'.DATA,',/,
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Wed Nov 24, 2010 10:46 pm    Post subject:
Reply with quote

Subhadeep Manna wrote:
Hi Skolusu
Please explain how the following statement works to provide the current date identifier
C'//FILE1 DD DSN=SYSHR.D',5,4,3,2,C'.DATA,',/,



Subhadeep Manna,

The INREC statement creates 1 record with current date using DATE1 keyword in CCYYMMDD format.

Code:

----+----1----+
20101124       


The OUTREC statement is just picking the MM DD YY values from the output generated from INREC.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Nov 25, 2010 12:36 am    Post subject:
Reply with quote

Hello and welcome to the forum,

Quote:
Please explain how the following statement works to provide the current date identifier
C'//FILE1 DD DSN=SYSHR.D',5,4,3,2,C'.DATA,',/,
As Skolusu explained - this reformats the date.

This obtains the date:
Code:
 INREC FIELDS=(DATE1)
Back to top
View user's profile Send private message
Subhadeep Manna

New User


Joined: 18 Oct 2010
Posts: 2
Location: India

PostPosted: Fri Nov 26, 2010 11:06 am    Post subject: Reply to: Attach current-date to output file-name ?
Reply with quote

Thanks for that... Skolusu and Dick.
I got it.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us