get the current system date through JCL ?
-
- Registered Member
- Posts: 16
- Joined: Sat Oct 04, 2014 9:36 am
get the current system date through JCL ?
Hi,
Any idea on how to get the current system date through JCL ?
Any idea on how to get the current system date through JCL ?
- Anuj Dhawan
- Founder
- Posts: 2805
- Joined: Sun Apr 21, 2013 7:40 pm
- Location: Mumbai, India
- Contact:
Re: get the current system date through JCL ?
Try this, using sort:
Code: Select all
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(5:&DATE1,13:&TIME2)
/*
Thanks,
Anuj
Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Anuj
Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
-
- Registered Member
- Posts: 16
- Joined: Sat Oct 04, 2014 9:36 am
Re: get the current system date through JCL ?
Thanks Anuj. This seems to work, is there any other way to do the same?
-
- Global Moderator
- Posts: 829
- Joined: Wed Sep 11, 2013 3:57 pm
Re: get the current system date through JCL ?
is there any other way to do the same?
why ask if the suggested method works ?
if You are not satisfied with the answer you received a paid consultant will be happy to work with you until you get the answer you like
![Cool 8-)](./images/smilies/cool.gif)
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort![Cool 8-)](./images/smilies/cool.gif)
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
![Cool 8-)](./images/smilies/cool.gif)
-
- Registered Member
- Posts: 16
- Joined: Sat Oct 04, 2014 9:36 am
Re: get the current system date through JCL ?
Thanks enrico for the comment.
I have told that we can do it without sort also, and there is a requirement to do it with out sort, so I've asked. I was not aware about it before.
I have told that we can do it without sort also, and there is a requirement to do it with out sort, so I've asked. I was not aware about it before.
-
- Global Moderator
- Posts: 829
- Joined: Wed Sep 11, 2013 3:57 pm
Re: get the current system date through JCL ?
then learn to collect all the requirement before asking for a solutionand there is a requirement to do it with out sort, I was not aware about it before.
the sort solution is the simplest available
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort![Cool 8-)](./images/smilies/cool.gif)
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
![Cool 8-)](./images/smilies/cool.gif)
Re: get the current system date through JCL ?
Hello.
There are a number of system symbols that are available for use in JCL which are documented here: https://www.ibm.com/docs/en/zos/3.1.0?t ... mic-system
The bulk of these symbols relate to dates and times. If you don't want the complete date/time formats provided, there are enough symbols available for you to roll your own date/time format.
There are a number of system symbols that are available for use in JCL which are documented here: https://www.ibm.com/docs/en/zos/3.1.0?t ... mic-system
The bulk of these symbols relate to dates and times. If you don't want the complete date/time formats provided, there are enough symbols available for you to roll your own date/time format.
- Anuj Dhawan
- Founder
- Posts: 2805
- Joined: Sun Apr 21, 2013 7:40 pm
- Location: Mumbai, India
- Contact:
Re: get the current system date through JCL ?
You can try using symbol converter EZACFSM1, as zum13 has indicated. One example is here of using symbol converter: viewtopic.php?p=3998#p3998
Thanks,
Anuj
Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Anuj
Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Re: get the current system date through JCL ?
The symbol converter isn't actually necessary. Since version 2, symbols can be put into in-stream data providing JES2 is told to resolve them via the "SYMBOLS" parameter. For example, the following will copy the date and time symbols to sysout:
This can be done with user-defined symbols as well, but some use of the "EXPORT" statement would be required.
The facility to use symbols in JCL statements has been around for rather longer so putting them into program parameters or something like a dataset name will work without the need for an additional program to be involved, for instance:
Code: Select all
//STEP2 EXEC PGM=ICEGENER
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
//SYSUT1 DD *,SYMBOLS=EXECSYS
&YYMMDD &HHMMSS
//SYSUT2 DD SYSOUT=*
The facility to use symbols in JCL statements has been around for rather longer so putting them into program parameters or something like a dataset name will work without the need for an additional program to be involved, for instance:
Code: Select all
//STEP1 EXEC PGM=PROG1,PARM='&YYMMDD'
//INPUT DD DSN=&SYSUID..D&YYMMDD,DISP=SHR
-
- Registered Member
- Posts: 16
- Joined: Sat Oct 04, 2014 9:36 am
Re: get the current system date through JCL ?
Thanks for the discussion. What is a symbol convertor?
Re: get the current system date through JCL ?
Prior to version 2, JES2 could not be told to substitute symbols into in-stream data so if you did
then the string "&YYMMDD &HHMMSS" is what would appear in the SYSUT1 input.
In order to get around this limitation for TCP/IP, a program called "EZACFSM1" was created which looks for the symbols in the input and does the substitutions. This is the symbol converter (it's actually referred to in the documentation as the "symbol translator utility": https://www.ibm.com/docs/en/zos/3.1.0?t ... em-symbols).
Code: Select all
//SYSUT1 DD *
&YYMMDD &HHMMSS
In order to get around this limitation for TCP/IP, a program called "EZACFSM1" was created which looks for the symbols in the input and does the substitutions. This is the symbol converter (it's actually referred to in the documentation as the "symbol translator utility": https://www.ibm.com/docs/en/zos/3.1.0?t ... em-symbols).
Create an account or sign in to join the discussion
You need to be a member in order to post a reply
Create an account
Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute