IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Connect:Direct - Add timestamp in the TODSN filename in JCL


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
aftabkhan

New User


Joined: 20 Mar 2009
Posts: 3
Location: Mumbai

PostPosted: Fri Mar 20, 2009 7:19 pm
Reply with quote

Hi Friends,

I have a sequential file which has to be sent to a Java console using connect:direct. The problem is that i have to include timestamp in the output file name i.e.:
FROMDSN=AFYXXX.xxx.abc
TODSN=aftab_khan_[YYYYMMDD]T[hhmmss].CSV

Can anyone please tell me how to include the date and time in a Connect:direct JCL.

Thanks
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Fri Mar 20, 2009 7:25 pm
Reply with quote

You can add date and time values to a filename from within the Process. There are a bunch of standard variables available for your use.

Your job scheduling system might be able to supply those values. Check with your support team.

Outside of that, you'll need a program to build your control statements with the supplied values. Anything should work: COBOL,Assembler,REXX,CLIST,SAS,DFSORT,SYNCSORT,Easytrieve,EZACFSM1, etc.
Back to top
View user's profile Send private message
aftabkhan

New User


Joined: 20 Mar 2009
Posts: 3
Location: Mumbai

PostPosted: Sun Mar 22, 2009 2:42 am
Reply with quote

Hi,

Thanks for your reply.

Can you give me example of some standard variables.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Sun Mar 22, 2009 7:53 am
Reply with quote

Quote:

Connect:Direct for z/OS provides the following intrinsic symbolic variables that you can use to substitute user-defined values when a Process is executed.

%DD2DSN Specifies an allocated DD statement, which references a DSN to be passed to a Process being submitted (for Connect:Direct for z/OS).

%JDATE Specifies the date the Process was submitted in Julian format. The variable is resolved as the submission date of the Process in the format yyyyddd. Among other uses, the value returned is suitable for
constructing a file name on the node receiving the file.
The value of the variable is resolved at Process submit time. The value
will correspond to the date on which the Process was submitted,
regardless of when or how many times the Process is actually executed.

%NUM1 Specifies the submission time of the Process in minutes, seconds, and fraction of seconds in the format mmssth.

%NUM2 Specifies the submitted time of a Process as the low order 4 bits of the milliseconds of the time expressed as 1 hex digit (a value from 0 through 15 expressed as 0 through F).

%PNODE PNODE name where the submit occurs.

%PRAND Pseudo-random number (6 hex digits).

%SUBDATE Specifies the date the Process was submitted in Gregorian format. The variable is resolved as the submission date of the Process in the format cyymmdd where c is the century indicator and is set to 0 for year 19yy or 1 for year 20yy. The value returned can be used to create a file name on the node receiving the file.

%SUBDATE1 Use this parameter to substitute the submitted date in the yyyymmdd date format.

%SUBDATE2 Use this parameter to substitute the submitted date in the yyyyddmm date format.

%SUBDATE3 Use this parameter to substitute the submitted date in the mmddyyyy date format.

%SUBDATE4 Use this parameter to substitute the submitted date in the ddmmyyyy date format.

%SUBTIME Specifies the time the process was submitted. The variable is resolved as the submission time of the process in the format hhmmss. The return value can be used to create a file name on the node receiving the file. The value of the variable is resolved at Process submit time. The value will correspond to the time at which the Process was submitted,
regardless of when or how many times the Process is actually executed.

%USER Specifies a variable that resolves to the user submitting the Process.
Back to top
View user's profile Send private message
YMPaines

New User


Joined: 24 Apr 2007
Posts: 2
Location: Newport Beach, CA

PostPosted: Sat Nov 21, 2009 3:21 am
Reply with quote

Can you provide a reference source for the intrinsic symbolic variable data above? I need to determine if there is a date parameter that will resolve to a mmddyy format.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Sat Nov 21, 2009 3:31 am
Reply with quote

The "Understanding Connect:Direct Processes" guide details that information. MMDDYYYY is %SUBDATE3.
Back to top
View user's profile Send private message
YMPaines

New User


Joined: 24 Apr 2007
Posts: 2
Location: Newport Beach, CA

PostPosted: Sat Nov 21, 2009 3:49 am
Reply with quote

The vendor indocates that they can't accept an eight character date, it must be only six characters.
Back to top
View user's profile Send private message
GautamSid

New User


Joined: 04 Jun 2021
Posts: 7
Location: India

PostPosted: Sun Jun 06, 2021 3:05 pm
Reply with quote

is there a way to add yesterdays date in the TO DSN file name?
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1246
Location: Bamberg, Germany

PostPosted: Sun Jun 06, 2021 4:45 pm
Reply with quote

icon_exclaim.gif Do not hijack year old topics. This should be locked now.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> All Other Mainframe Topics

 


Similar Topics
Topic Forum Replies
No new posts To get the count of rows for every 1 ... DB2 3
No new posts Connect Direct 6.3 for Z/OS All Other Mainframe Topics 20
No new posts Insert system time/date (timestamp) u... DFSORT/ICETOOL 5
No new posts Timestamp difference and its average ... DB2 11
No new posts Getting TWA in CICS program while con... CICS 14
Search our Forums:

Back to Top