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

reffering the filename with date and time in JCL


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Sat Jun 06, 2020 5:20 pm
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: 2455
Location: Hampshire, UK

PostPosted: Sat Jun 06, 2020 6:06 pm
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

Senior Member


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

PostPosted: Sat Jun 06, 2020 9:29 pm
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 Member


Joined: 01 Sep 2015
Posts: 712
Location: Denmark

PostPosted: Sun Jun 07, 2020 1:48 am
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

Senior Member


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

PostPosted: Sun Jun 07, 2020 8:14 am
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: 3049
Location: NYC,USA

PostPosted: Sun Jun 07, 2020 10:01 am
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

Senior Member


Joined: 29 Apr 2008
Posts: 2012
Location: USA

PostPosted: Sun Jun 07, 2020 9:10 pm
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: 1042
Location: Richmond, Virginia

PostPosted: Wed Jun 10, 2020 5:50 am
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts To get the the current time DFSORT/ICETOOL 13
No new posts RC query -Time column CA Products 3
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts C Compile time time stamps Java & MQSeries 10
Search our Forums:

Back to Top