Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 4650
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 Where to get sample for processing RM... vice_versa PL/I & Assembler 2 Tue Jan 16, 2018 2:03 pm
No new posts VSAM dataset not found abdulrafi JCL & VSAM 5 Fri Jan 12, 2018 11:19 am
No new posts File Tailoring -- Temporary dataset i... samzee71 CLIST & REXX 3 Fri Dec 01, 2017 3:12 am
No new posts Fetching data from JHS as per the cur... arunsoods All Other Mainframe Topics 4 Wed Nov 22, 2017 1:54 pm
No new posts Date in where clause - Windows Karthikeyan Subbarayan DB2 9 Wed Nov 15, 2017 9:07 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us