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
 

 

Creating dataset with current date & timestamp

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
View previous topic :: :: View next topic  
Author Message
chkiran2

New User


Joined: 24 Jun 2004
Posts: 24
Location: Gurgoan

PostPosted: Sat Oct 16, 2004 6:31 pm    Post subject: Creating dataset with current date & timestamp
Reply with quote

Hi

I got this done by 2 methods. One using only JCL and the other using COBOL program. I am giving both the methods so that it will be useful for some one in future.

Method 1: (USING JCL)

The following JCL creates a dataset with Current date & time at the time of creation of dataset and copies the data from a source dataset into the newly created dataset.

Code:


//ABAB77V1 JOB (0400,PT,PES),'KIRAN',CLASS=C,MSGCLASS=X,             
//         MSGLEVEL=(1,1),NOTIFY=ABAB77,REGION=0008192K             
//STEP0100 EXEC PGM=EZACFSM1                                         
//SYSOUT    DD SYSOUT=(*,INTRDR)                                     
//SYSIN     DD DATA,DLM=@@                                           
//ABAB77V2 JOB (0400,PT,PES),                                       
//             'VIJAY',                                             
//             CLASS=C,                                             
//             MSGCLASS=X,                                           
//             NOTIFY=&SYSUID                                       
//STEPK1   EXEC PGM=IEBGENER                                         
//SYSPRINT DD SYSOUT=*                                               
//SYSUT1   DD DSN=ABAB.TX.SND.SQUS0001.SI,DISP=SHR                   
//SYSUT2   DD DSN=ABAB.TX.SND.SQUS0001.SI.D&LYYMMDD..T&LHHMMSS,     
//            DISP=(NEW,CATLG,DELETE),                               
//            SPACE=(CYL,(2,2),RLSE),                 
//            DCB=(LRECL=890,RECFM=FB)                 
//SYSIN   DD  DUMMY                                   
@@                                                     



Method 2:

we can get the desired result using COBOL program. Here is the tested program which allocates/creates a new dataset and then copies the data from an file to the newly created file using IEBGENER.

I am sharing this so that it may be useful for some one later.


Code:

 
COBOL PROGRAM:
 
       IDENTIFICATION DIVISION.
       PROGRAM-ID. DSDATE.
       ENVIRONMENT DIVISION.
       DATA DIVISION.             
       WORKING-STORAGE SECTION.
       01 WS-DATE                       PIC X(06).
       01 WS-TIME-IN                    PIC X(08).                     
       01 WS-TIME                       PIC X(06).                     
      *                                                                 
       PROCEDURE DIVISION.                                             
      *                                                                 
       000-MAIN.                                                       
           ACCEPT WS-DATE               FROM  DATE.                     
           ACCEPT WS-TIME-IN            FROM  TIME.                     
           MOVE WS-TIME-IN (1:6)        TO WS-TIME.                     
           DISPLAY '//KIRAN1CD JOB (0400,XXX),''KIRAN CH'',CLASS=B,'   
           DISPLAY '//        MSGLEVEL=(1,1),NOTIFY=MGPB16,REGION=4M,'
           DISPLAY '//         MSGCLASS=X'                             
           DISPLAY '//GENER01  EXEC PGM=IEBGENER'                       
           DISPLAY '//SYSIN    DD DUMMY'                               
           DISPLAY '//SYSPRINT DD SYSOUT=*'                             
           DISPLAY '//SYSUT1   DD DSN=XYXYXY.TST.DATA,DISP=SHR'         
           DISPLAY '//SYSUT2   DD DSN=XYXYXY.D' WS-DATE '.'             
                    'T' WS-TIME ','                                     
           DISPLAY '//         DISP=(NEW,CATLG,DELETE),'               
           DISPLAY '//      DCB=(LRECL=80,RECFM=FB,BLKSIZE=0,DSORG=PS),'
           DISPLAY '//         SPACE=(TRK,(09,03),RLSE),'               
           DISPLAY '//         UNIT=DISK'                               
           DISPLAY '/*EOF'                                             
           DISPLAY '//'.                                               
       000-EXIT.                                                       
           STOP RUN.                                                   
 

Compile above program and use following JCL to execute this:
 
//KIRANCD  JOB (0400,XXX),'KIRAN CH',CLASS=B,           
//         MSGLEVEL=(1,1),NOTIFY=MGPB16,REGION=4M,     
//         MSGCLASS=X                                   
//STEP01   EXEC PGM=DSDATE                             
//STEPLIB  DD DSN=XYXYXY.TEST.PRG,DISP=SHR             
//SYSOUT   DD SYSOUT=(*,INTRDR)                         
//SYSIN    DD DUMMY                                     
//                                                     
 
 
Back to top
View user's profile Send private message

Ramya A

Active User


Joined: 26 Jul 2004
Posts: 104

PostPosted: Wed Oct 20, 2004 3:10 pm    Post subject:
Reply with quote

Hi,

Could you tell me what is this pgm EZACFSM1 in your JCL. Is it an Ezitrive code? Also it would be nice if you can explain how your JCL achieves the result i.e. from where it gets the date and time parameters LYYMMDD and LHHMMSS.

Thanks,
Ramya icon_smile.gif
Back to top
View user's profile Send private message
superk

Moderator Team Head


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

PostPosted: Wed Oct 20, 2004 3:30 pm    Post subject:
Reply with quote

The EZACFSM1 program is part of TCP/IP. It is known as the "symbol translator utility". EZACFSM1 reads an input file and writes to an output file, translating any symbols in the process.

See reference here: http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/f1a1b330/1.1.9.1?DT=20030829121943

The symbols it translates are the MVS built-in dynamic system symbols. A basic set is provided by IBM, and others can be created by your MVS systems programmers. You can check here for the list of standard dynamic system variables: http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IEA1E241/2.2.2
Back to top
View user's profile Send private message
Ramya A

Active User


Joined: 26 Jul 2004
Posts: 104

PostPosted: Wed Oct 20, 2004 5:18 pm    Post subject:
Reply with quote

Thanks Superk. I'll try the references given by you.
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 -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Fileaid 2 commands instream work. In ... descann Compuware & Other Tools 2 Tue May 16, 2017 3:31 pm
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts SMTP the current generation number of... Jyothi Kulunde JCL & VSAM 4 Thu May 04, 2017 4:08 pm
No new posts To find out size allocated to a seque... ashek15 JCL & VSAM 15 Thu Apr 27, 2017 9:42 am
No new posts LISTIDR compiled date/time jerryte IBM Tools 3 Thu Apr 20, 2017 7:37 pm


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