Portal | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
reffering the filename with date and time in JCL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
skbk

New User


Joined: 05 Jun 2020
Posts: 2
Location: India

PostPosted: Sat Jun 06, 2020 4:57 pm    Post subject: reffering the filename with date and time in JCL
Reply with quote

I have generated a file with date and time . And we will receive multiple files
a day. each file will be created with date and time in the name and I want to merge all the file and copy it into a GDG. How do I refer to this files in JCL
Back to top
View user's profile Send private message

enrico-sorichetti

Senior Member


Joined: 14 Mar 2007
Posts: 10700
Location: italy

PostPosted: Sat Jun 06, 2020 5:20 pm    Post subject: Reply to: reffering the filename with date and time in JCL
Reply with quote

the same way You would refer to any other dataset icon_cool.gif
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2407
Location: Hampshire, UK

PostPosted: Sat Jun 06, 2020 6:06 pm    Post subject: Reply to: reffering the filename with date and time in JCL
Reply with quote

They are datasets not files (unless you are using USS).

Write a program in a language of your choice and do the following:

LISTC of the high level indicies
extract those created today
generate the JCL to concatenate those datasets
submit the JCL
Save the JCL (in the event of failure)
Back to top
View user's profile Send private message
Joerg.Findeisen

Active User


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

PostPosted: Sat Jun 06, 2020 9:29 pm    Post subject:
Reply with quote

One can do that with two jobs. It must be assured that all timestamped DSN have the same DCB.

Allocate a LIBRARY DSORG=PO,LRECL=80,RECFM=FB,BLKSIZE=0 as &SYSUID..MY.PROC before you start.

First job:
Code:
//    SET PROC=&SYSUID..MY.PROC                                       
//LISTCAT  EXEC PGM=IDCAMS                                             
//SYSPRINT DD DISP=(NEW,PASS,DELETE),UNIT=SYSALLDA,                   
//            SPACE=(CYL,(2,1),RLSE),                 
//            DSORG=PS,RECFM=VBA,LRECL=125,BLKSIZE=0                   
//SYSIN    DD *                                                       
  LISTC LVL(<list_what's_to_be_copied>) NAMES CREATION(0)
/*                                                                     
//GENERATE EXEC PGM=ICEMAN,PARM='MSG=NO'                               
//SORTIN   DD DISP=(OLD,PASS),DSN=*.LISTCAT.SYSPRINT                   
//SYSOUT   DD SYSOUT=*                                                 
//SYSUT1   DD DSN=&PROC.(SYSUT1),                                     
//            DISP=(OLD),UNIT=SYSALLDA,DSNTYPE=LIBRARY,               
//            SPACE=(CYL,(2,1,1),RLSE),             
//            DSORG=PS,RECFM=FB,LRECL=80,BLKSIZE=0                     
//SYSIN    DD *                                                       
  OPTION COPY,VLSCMP                                                   
  INCLUDE COND=(6,16,CH,EQ,C'NONVSAM ------- ')                       
  INREC IFOUTLEN=84,IFTHEN=(WHEN=INIT,BUILD=(1,4,22,44,SEQNUM,3,ZD)), 
    IFTHEN=(WHEN=(49,3,ZD,EQ,+1),                                     
      BUILD=(1,4,C'//SYSUT1',3X,C'DD DISP=SHR,DSN=',5,44)),           
    IFTHEN=(WHEN=NONE,BUILD=(1,4,C'//',9X,C'DD DISP=SHR,DSN=',5,44))   
  OUTFIL FNAMES(SYSUT1),                                               
    VTOF,REMOVECC,                                                     
    BUILD=(5,80)                                                       
  END                                                                 
/*

Second Job referencing the recently built DD:SYSUT1
Code:
//    SET PROC=&SYSUID..MY.PROC
//    JCLLIB ORDER=(&PROC.)     
//IEBGENER EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1   INCLUDE MEMBER=SYSUT1
//SYSUT2   DD <you name it>..
//SYSIN    DD DUMMY
Back to top
View user's profile Send private message
Willy Jensen

Active User


Joined: 01 Sep 2015
Posts: 386
Location: Denmark

PostPosted: Sun Jun 07, 2020 1:48 am    Post subject:
Reply with quote

Using ISPF skeleton services, sample
Code:
)CM Demo use of TSO / REXX features in an ISPF skeleton   
)CM Make DD concatenation                                 
                                                         
)CM Make list of datasets                                 
)REXX STACKN                                             
 zz=outtrap('lst.')                                       
 "listcat lvl("userid()".test) nonvsam"                   
 zz=outtrap('off')                                       
 "delstack"                                               
 do n=1 to lst.0                                         
   if word(lst.n,1)<>'NONVSAM' then iterate               
   dsn=word(lst.n,3)                                     
   zz=Listdsi("'"dsn"'")                                 
   if sysdsorg='PO' then queue word(lst.n,3)             
 end                                                     
 STACKN=queued()                                         
)ENDREXX                                                 
                                                         
)CM Make DD statement                                     
)SET DD = INPUT                                           
)DO N = 1 TO &STACKN                                     
)REXX DSN DD STMT                                         
 pull dsn                                                 
 stmt= '//'left(dd,8) 'DD DISP=SHR,DSN='dsn               
 dd=''                                                   
)ENDREXX                                                 
&STMT                                                     
)ENDDO                                                   
Back to top
View user's profile Send private message
Joerg.Findeisen

Active User


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

PostPosted: Sun Jun 07, 2020 8:14 am    Post subject:
Reply with quote

@Willy: As a JCL solution was wanted, yours is good but doesn't qualify.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 2467
Location: NY,USA

PostPosted: Sun Jun 07, 2020 10:01 am    Post subject: Re: reffering the filename with date and time in JCL
Reply with quote

skbk wrote:
I have generated a file with date and time . And we will receive multiple files
a day. each file will be created with date and time in the name and I want to merge all the file and copy it into a GDG. How do I refer to this files in JCL

Why don't to talk to OPC/Scheduling group? How are you getting the data set?NDM or SFTP? Just do the +1 GDG as and when you get the Data set and concate (0) and (+1) to get (+2) and it will do the task and always you will have a roll over data and latest one instead of waiting at the end and convolute the process of merge.
Back to top
View user's profile Send private message
sergeyken

Active Member


Joined: 29 Apr 2008
Posts: 825
Location: Maryland

PostPosted: Sun Jun 07, 2020 9:10 pm    Post subject:
Reply with quote

Joerg.Findeisen wrote:
@Willy: As a JCL solution was wanted, yours is good but doesn't qualify.

JCL has no ability to manipulate with date/time values, especially as part of DSNAME. Period.

The author has to find (or to ask for) another approach, instead of repeating his initial “requirements” as a mantra.
Back to top
View user's profile Send private message
Phrzby Phil

Senior Member


Joined: 31 Oct 2006
Posts: 1010
Location: Richmond, Virginia

PostPosted: Wed Jun 10, 2020 5:50 am    Post subject:
Reply with quote

Does this do what you want?

1. Land each day's datasets as successive new generations of a daily GDG
2. At end of day, copy the concatenation of all of the daily generations to the next generation of your permanent GDG
3. Delete all generations of the daily GDG

Whether this or a previous reply worked for you, please let us know. As a new member, you'll find people really appreciate feedback.
Back to top
View user's profile Send private message
skbk

New User


Joined: 05 Jun 2020
Posts: 2
Location: India

PostPosted: Fri Jun 19, 2020 7:19 pm    Post subject: Reply to: reffering the filename with date and time in JCL
Reply with quote

Thanks Everyone for your inputs and solutions.
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to process dependent file based o... HithaSri JCL & VSAM 8 Sun Sep 06, 2020 12:42 pm
No new posts Required Date Format in Include Sort ... vivky_vivek DFSORT/ICETOOL 6 Fri Aug 14, 2020 6:52 am
No new posts Trying to add current date in place o... shub2204 DFSORT/ICETOOL 8 Wed Aug 12, 2020 4:14 pm
No new posts Populating Date and Sequence numer in... PORYES SYNCSORT 11 Thu Jul 16, 2020 5:01 pm
No new posts How to filter out certain records bas... manugeorge2004 JCL & VSAM 5 Wed Jun 17, 2020 10:05 pm

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