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

To Fetch System Date


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
raajan_p

New User


Joined: 19 Sep 2005
Posts: 17

PostPosted: Thu Dec 22, 2005 2:24 pm
Reply with quote

Hi,

Can any let me know the sample jcl to retrieve system date. thanks in advance.

regards,
raajan
Back to top
View user's profile Send private message
suganthyprabha

New User


Joined: 28 Jul 2005
Posts: 58

PostPosted: Thu Dec 22, 2005 2:57 pm
Reply with quote

Hi Rajan,

U can do this by 2 ways.

Method 1:
=======
Code:
                                             
//S1  EXEC PGM=ICEMAN                                             
//SYSPRINT DD SYSOUT=*                                             
//SYSOUT   DD SYSOUT=*                                             
//SORTIN   DD *                                                   
DUMMY                                                             
//SORTOUT  DD SYSOUT=*                                             
//SYSIN    DD *                                                   
    OPTION COPY                                                   
    OUTREC FIELDS=(DATE,TIME)                                     
/* 


Method 2:
=======
Code:
                                               
//S1 EXEC PGM=ICEMAN                                               
//SORTIN  DD DUMMY,RECFM=FB,LRECL=80,BLKSIZE=800                   
//SORTOUT DD DSN=X.Y.O2,DISP=(NEW,CATLG),                 
//           SPACE=(TRK,(2,2)),                                   
//           DCB=(RECFM=FB,LRECL=80,BLKSIZE=800)                   
//SYSIN   DD *                                                     
    OPTION COPY                                                   
    OUTFIL REMOVECC,NODETAIL,HEADER1=(DATE,TIME)                   
/*         
//SYSOUT   DD SYSOUT=*

Thanks and Regards,
Suganthy.
Back to top
View user's profile Send private message
manjinder

New User


Joined: 04 Dec 2005
Posts: 45
Location: pune

PostPosted: Mon Jan 09, 2006 3:26 pm
Reply with quote

i have tried first method but it is giving maxcc 16 showing on spool like this OPTION COPY
OUTREC FIELDS=(DATE,TIME)
$
Back to top
View user's profile Send private message
iknow

Active User


Joined: 22 Aug 2005
Posts: 411
Location: Colarado, US

PostPosted: Wed Jan 11, 2006 11:12 am
Reply with quote

Hi raajan_p,

You can also try this to get the system date and time.

Code:
//R010   EXEC  PGM=SORT                             
//SORTIN  DD *         
//SORTOUT DD SYSOUT=*                               
//SYSOUT  DD SYSOUT=*                               
//SYSIN   DD *                                     
  SORT FIELDS=COPY                                 
  OUTFIL HEADER1=(DATE,/,TIME,80:X),REMOVECC   
/*                               



80:X (in general nnnn:X) is used to fill empty spaces (blanks) till column 80 (or nnnn) from the current position. If you omit this parameter and if you do not provide DCB-LRECL in JCL, your output file length is ends after the last field that you provide in INREC/OUTREC/OUTFIL OUTREC/HEADER/TRAILER statements.

Try this code to see the difference

Code:

Code:
//R010   EXEC  PGM=SORT                             
//SORTIN  DD *         
//SORTOUT DD DSN=your.output.file,
//         DISP=(NEW,CATLG,DELETE),
//         UNIT=SYSDA,
//         SPACE=(TRK,(1,1),RLSE)
//SYSOUT  DD SYSOUT=*                               
//SYSIN   DD *                                     
  SORT FIELDS=COPY                                 
  OUTFIL HEADER1=(DATE,/,
                  TIME),REMOVECC   
/*         




PS: The JCL shown above does not contain a DCB parameter for SORTOUT. Do not make any changes to the JCL. Try running the JCL and see the LRECL of OUTPUT file and try with 80:X and see the difference.


NOTE

Actually, the 80:X doesn't do anything in this case. The output record length is set from the length of the data records, NOT from the length of the HEADER records. In this case, the length of the data records is 80 = the length of the input records.

80:X would be necessary if an OUTREC parameter created shorter records and you wanted them padded out with blanks to 80 bytes.



Hope this helps.
Back to top
View user's profile Send private message
mrar_160

New User


Joined: 14 Sep 2005
Posts: 48

PostPosted: Wed Jan 25, 2006 10:06 am
Reply with quote

Hi all.

I did all the method above.. But still cannot got the system date . Below i paste my JCL..

Code:

//S1 EXEC PGM=ICEMAN                                               
//SORTIN  DD DUMMY,RECFM=FB,LRECL=80,BLKSIZE=800                   
//SORTOUT DD DSN=DATASET.DATE,DISP=(MOD,CATLG),                     
//           SPACE=(TRK,(2,2)),                                     
//           DCB=(RECFM=FB,LRECL=80,BLKSIZE=800)                   
//SYSIN   DD *                                                     
     OPTION COPY                                                     
     OUTFIL REMOVECC,NODETAIL,HEADER1=(DATE,TIME)                   
/*


After submit the jcl, i got this..
Quote:
PREFIX=* DEST=(ALL) OWNER=SYS
NP DDNAME STEPNAME PROCSTEP
JESMSGLG JES2
JESJCL JES2
JESYSMSG JES2


Inside JESMSGLG

Quote:

11.48.17 JOB09628 +ICE158A 0 SYS1001F.S1 SYSOUT DD STATEMENT MISSING
11.48.17 JOB09628 - --TIMINGS (M
11.48.17 JOB09628 -JOBNAME STEPNAME PROCSTEP RC EXCP CONN TCB SRB
11.48.17 JOB09628 -SYS1001F S1 20 9 1 .00 .00
11.48.17 JOB09628 IEF404I SYS1001F - ENDED - TIME=11.48.17
11.48.17 JOB09628 -SYS1001F ENDED. NAME- TOTAL TCB CPU TIM
11.48.17 JOB09628 $HASP395 SYS1001F ENDED
------ JES2 JOB STATISTICS ------
25 JAN 2006 JOB EXECUTION DATE
14 CARDS READ
45 SYSOUT PRINT RECORDS
0 SYSOUT PUNCH RECORDS
2 SYSOUT SPOOL KBYTES
0.00 MINUTES EXECUTION TIME
******************************** BOTTOM OF DATA ********************************


Inside JESJCL
Quote:

2 //S1 EXEC PGM=ICEMAN
3 //SORTIN DD DUMMY,RECFM=FB,LRECL=80,BLKSIZE=800
4 //SORTOUT DD DSN=DATASET.DATE,DISP=(MOD,CATLG),
// SPACE=(TRK,(2,2)),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=800)
5 //SYSIN DD *
***************************** BOTTOM OF DATA *******************************


Inside JESYSMSG
Quote:

IEF142I SYS1001F S1 - STEP WAS EXECUTED - COND CODE 0020
IGD104I SYS1001.DATE RETAINED, DDNAME=SORTOUT
IEF285I SYS1001.SYS1001F.JOB09628.D0000101.? SYSIN
IEF373I STEP/S1 /START 2006025.1148
IEF374I STEP/S1 /STOP 2006025.1148 CPU 0MIN 00.01SEC SRB 0MIN 00.00S
IEF375I JOB/SYS1001F/START 2006025.1148
IEF376I JOB/SYS1001F/STOP 2006025.1148 CPU 0MIN 00.01SEC SRB 0MIN 00.00S


Then, went i try to browse the dateset (DATASET.DATE) which is to store the date, it empty..

Can anybody help to solve this problem?

Thank .
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Jan 25, 2006 10:04 pm
Reply with quote

The DFSORT error message tells you exactly what's wrong:

11.48.17 JOB09628 +ICE158A 0 SYS1001F.S1 SYSOUT DD STATEMENT MISSING

You are missing the //SYSOUT DD statement. Add:

//SYSOUT DD SYSOUT=*

-----
Code:

  OUTREC FIELDS=(DATE,TIME)


works fine with DFSORT as long as you have one or more blanks before OUTREC.
-----
Note that Method 1 and Method 2 posted by Suganthy put the date and time in the same record in the form:

mm/dd/yyhh:mm:ss

The method shown by iknow puts the date and time in two separate records (because of the /).
-----
You can use other parameters to get the date and time in different forms.

See the following "Ask Professor Sort" item for more information:

www.ibm.com/servers/storage/support/software/sort/mvs/professor_sort/srtmatsm.html
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Thu Jan 26, 2006 1:05 am
Reply with quote

This is an alternative job that yields the same results:
Code:

//*                                                       
//S2       EXEC PGM=EZACFSM1                             
//SYSOUT   DD   DSN=&SYSUID..DATE,DISP=(,CATLG),       
//         SPACE=(TRK,(2,2)),UNIT=SYSDA                   
//SYSIN    DD   *                                         
&MON/&DAY/&YR2 &LHR:&LMIN:&LSEC                           
/*                                                       
//*                                                       
Back to top
View user's profile Send private message
mrar_160

New User


Joined: 14 Sep 2005
Posts: 48

PostPosted: Thu Jan 26, 2006 8:09 am
Reply with quote

Thank for quick reply my friends..
By the way, i tried as what Frank Yaeger and superk answer..

Frank Yaeger,
i add the //SYSOUT DD SYSOUT=* statment in my JCL.. See my JCL below..
Quote:

//S1 EXEC PGM=ICEMAN
//SORTIN DD DUMMY,RECFM=FB,LRECL=80,BLKSIZE=800
//SORTOUT DD DSN=SYS1001.DATE,DISP=(MOD,CATLG),
// SPACE=(TRK,(2,2)),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=800)
//SYSIN DD *

OUTREC FIELDS=(DATE,TIME)
//SYSOUT DD SYSOUT=*
/*


I add the statment after outrec..So, after i submit, i got msg in SYSOUT tell me that NO SORT OR MERGE CONTROL STATEMENT..Below is the msg after submit my JCL..

Inside JESMSGLG
Quote:

10.11.14 JOB09726 IEF403I SYS1001F - STARTED - TIME=10.11.14
10.11.14 JOB09726 - --TIMINGS (M
10.11.14 JOB09726 -JOBNAME STEPNAME PROCSTEP RC EXCP CONN TCB SRB
10.11.14 JOB09726 -SYS1001F S1 16 20 3 .00 .00
10.11.14 JOB09726 IEF404I SYS1001F - ENDED - TIME=10.11.14
10.11.14 JOB09726 -SYS1001F ENDED. NAME- TOTAL TCB CPU TIM
10.11.14 JOB09726 $HASP395 SYS1001F ENDED
------ JES2 JOB STATISTICS ------
26 JAN 2006 JOB EXECUTION DATE
15 CARDS READ
55 SYSOUT PRINT RECORDS
0 SYSOUT PUNCH RECORDS
3 SYSOUT SPOOL KBYTES
0.00 MINUTES EXECUTION TIME


Inside JESJCL
Quote:

IEFC653I SUBSTITUTION JCL - 090000,CLASS=A,MSGCLASS=X,NOTIFY=SYS1001,R
2 //S1 EXEC PGM=ICEMAN
3 //SORTIN DD DUMMY,RECFM=FB,LRECL=80,BLKSIZE=800
4 //SORTOUT DD DSN=SYS1001.DATE,DISP=(MOD,CATLG),
// SPACE=(TRK,(2,2)),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=800)
5 //SYSIN DD *
6 //SYSOUT DD SYSOUT=*
/*


Inside JESYSMSG
Quote:

IEF236I ALLOC. FOR SYS1001F S1
IEF237I DMY ALLOCATED TO SORTIN
IGD103I SMS ALLOCATED TO DDNAME SORTOUT
IEF237I JES2 ALLOCATED TO SYSIN
IEF237I JES2 ALLOCATED TO SYSOUT
IEF142I SYS1001F S1 - STEP WAS EXECUTED - COND CODE 0016
IGD104I SYS1001.DATE RETAINED, DDNAME=SORTOUT
IEF285I SYS1001.SYS1001F.JOB09726.D0000101.? SYSIN
IEF285I SYS1001.SYS1001F.JOB09726.D0000102.? SYSOUT
IEF373I STEP/S1 /START 2006026.1011
IEF374I STEP/S1 /STOP 2006026.1011 CPU 0MIN 00.01SEC SRB 0MIN 00.00S
IEF375I JOB/SYS1001F/START 2006026.1011
IEF376I JOB/SYS1001F/STOP 2006026.1011 CPU 0MIN 00.01SEC SRB 0MIN 00.00S
******************************** BOTTOM OF DATA ********************************


Inside SYSOUT
Quote:

ICE000I 1 --- CONTROL STATEMENTS/MESSAGES ---- 5740-SM1 REL 13.0 ---- 10.11.14 J

OUTREC FIELDS=(DATE,TIME)
$
ICE007A 1 SYNTAX ERROR
ICE010A 0 NO SORT OR MERGE CONTROL STATEMENT
ICE052I 3 END OF DFSORT


Beside, i also try to put the //SYSOUT DD SYSOUT=* before outrec.. But i got same msg like above..
Can you help to find the mistake?

Superk
I also tried you method, but i got the msg as below..
Quote:

CSV003I REQUESTED MODULE EZACFSM1 NOT FOUND
CSV028I ABEND806-04 JOBNAME=PEP1001F STEPNAME=S2
IEA995I SYMPTOM DUMP OUTPUT
SYSTEM COMPLETION CODE=806 REASON CODE=00000004
TIME=10.22.57 SEQ=12159 CPU=0000 ASID=0048
PSW AT TIME OF ERROR 070C1000 812E73DE ILC 2 INTC 0
NO ACTIVE MODULE FOUND
NAME=UNKNOWN


I think in my OS390, there is no EZACFSM1 facility.Am i correct superk?
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Jan 26, 2006 10:00 pm
Reply with quote

You're going backwards. You had:

Code:

     OPTION COPY 


and you removed it. Put it back. And you need one or more blanks before each statement (substitute a blank for each b):

Code:

bbOPTION COPY
bbOUTREC FIELDS=(DATE,TIME)
Back to top
View user's profile Send private message
mrar_160

New User


Joined: 14 Sep 2005
Posts: 48

PostPosted: Mon Feb 06, 2006 11:47 am
Reply with quote

Ok..tq Frank Yaeger..
I will try now..
Back to top
View user's profile Send private message
mrar_160

New User


Joined: 14 Sep 2005
Posts: 48

PostPosted: Mon Feb 06, 2006 12:02 pm
Reply with quote

Frank Yaeger

I've tried to put back the option, but i got RC16..
See below..

JCL

Quote:

//S2 EXEC PGM=ICEMAN
//SORTIN DD *
//SORTOUT DD DSN=PEP1001.DATE,DISP=(MOD,CATLG),
// SPACE=(TRK,(2,2)),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=800)
//SYSIN DD *
OPTION COPY
OUTREC FIELDS=(DATE,TIME)
//SYSOUT DD SYSOUT=*
/*


Inside SYSOUT S2
Quote:
ICE143I 0 BLOCKSET COPY TECHNIQUE SELECTED
ICE000I 1 --- CONTROL STATEMENTS/MESSAGES ---- 5740-SM1 REL 13.0 ---- 14.18.50 F
OPTION COPY
OUTREC FIELDS=(DATE,TIME)
$
ICE007A 1 SYNTAX ERROR
ICE052I 3 END OF DFSORT


I really need the solutions..
TQ
Back to top
View user's profile Send private message
mrar_160

New User


Joined: 14 Sep 2005
Posts: 48

PostPosted: Mon Feb 06, 2006 1:59 pm
Reply with quote

Ops:
Code:

//S2 EXEC PGM=ICEMAN                                                   
//SORTIN  DD *                                                         
//SORTOUT DD DSN=PEP1001.DATE,DISP=(MOD,CATLG),                         
//           SPACE=(TRK,(2,2)),                                         
//           DCB=(RECFM=FB,LRECL=80,BLKSIZE=800)                       
//SYSIN   DD *                                                         
    OPTION COPY                                                         
    OUTREC FIELDS=(DATE,TIME)                                           
//SYSOUT   DD SYSOUT=*                                                 
/*                         
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Mon Feb 06, 2006 10:22 pm
Reply with quote

I just noticed the following in your messages:

Code:

5740-SM1 REL 13.0


That shows you are using DFSORT R13. DFSORT R13 is very old and is, in fact, out of service. You need one of the supported releases, Release 14 or z/OS DFSORT V1R5, in order to use the DATE and TIME parameters.

Ask your System Programmers to install one of these supported releases.
Back to top
View user's profile Send private message
mrar_160

New User


Joined: 14 Sep 2005
Posts: 48

PostPosted: Tue Feb 07, 2006 7:54 am
Reply with quote

Oh i see..
actually i am a one of system programmer in my companie. But i ask my friends (system programmer also), he also dont know how to install Release 14..
Can you guide me how to get the version Release 14?.
Or is there any other way to fetch system date using REL 13.0?

TQ.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Feb 07, 2006 10:40 pm
Reply with quote

I'm not a system programmer, so I can't tell you how to install products. I thought that's what system programmers did. If you have a valid license for DFSORT, then you should be able to install the appropriate supported release for the z/OS release you're running on (DFSORT R14 for z/OS V1R4 and below or z/OS DFSORT V1R5 for z/OS V1R5 and above). Ask whoever installs products on your system how to do it.
Back to top
View user's profile Send private message
mrar_160

New User


Joined: 14 Sep 2005
Posts: 48

PostPosted: Wed Feb 08, 2006 7:10 am
Reply with quote

Ok..Thank you Frank Yaeger..
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 -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Sysplex System won't IPL at DR site I... All Other Mainframe Topics 2
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts How to delete a user's alias from the... JCL & VSAM 11
Search our Forums:

Back to Top