|
View previous topic :: View next topic
|
| Author |
Message |
skbk
New User
Joined: 05 Jun 2020 Posts: 2 Location: India
|
|
|
|
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 |
|
 |
enrico-sorichetti
Superior Member

Joined: 14 Mar 2007 Posts: 10903 Location: italy
|
|
|
|
the same way You would refer to any other dataset  |
|
| Back to top |
|
 |
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
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 |
|
 |
Joerg.Findeisen
Senior Member

Joined: 15 Aug 2015 Posts: 1442 Location: Bamberg, Germany
|
|
|
|
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 |
|
 |
Willy Jensen
Active Member

Joined: 01 Sep 2015 Posts: 774 Location: Denmark
|
|
|
|
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 |
|
 |
Joerg.Findeisen
Senior Member

Joined: 15 Aug 2015 Posts: 1442 Location: Bamberg, Germany
|
|
|
|
| @Willy: As a JCL solution was wanted, yours is good but doesn't qualify. |
|
| Back to top |
|
 |
Rohit Umarjikar
Global Moderator

Joined: 21 Sep 2010 Posts: 3109 Location: NYC,USA
|
|
|
|
| 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 |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2286 Location: USA
|
|
|
|
| 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 |
|
 |
Phrzby Phil
Senior Member
Joined: 31 Oct 2006 Posts: 1055 Location: Richmond, Virginia
|
|
|
|
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 |
|
 |
skbk
New User
Joined: 05 Jun 2020 Posts: 2 Location: India
|
|
|
|
| Thanks Everyone for your inputs and solutions. |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|