View previous topic :: View next topic
|
Author |
Message |
ojdiaz
New User
Joined: 19 Nov 2008 Posts: 98 Location: Spain
|
|
|
|
Hi
I have a request in which i need to Process several Files at the same time in the form:
FILENAME.NAME001.DATE*
We have a file for each month of the year, for every year. The date part is in the form: D200901, D200902, etc...
The thing is, I need to sort all files in a given year, any given time, and the job doesn't know at that time, how many files there are. Since the files are updated and generated at random dates, I can't acummulate the files at a given or specific time, nor modify the job every month, so i can't code the job like this:
Code: |
//SORTIN DD DSN=FILENAME.NAME001.D200901,DISP=SHR
// DD DSN=FILENAME.NAME001.D200902,DISP=SHR
// DD ETC.....
|
My question is, is there a way to read all files at once, and then copy them to a single file, wich would be a Sortin file for a later sort step?
I know Listcat can read catalog entries, but, is there a way to read altogether all the files using an * wildcard and copy them to a new file in a JCL step, instead of processing every file by separate?
I'm sorry for my lousy english . I hope that made sense
Thanks in Advance
Oliver |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
Have you considered GDGs? |
|
Back to top |
|
|
ojdiaz
New User
Joined: 19 Nov 2008 Posts: 98 Location: Spain
|
|
|
|
In this particular case i can't work with GDG files. All the files are in cartridges, are deleted and created constantly, so the generational indexing would be lost. Also, in this client, well, i'll just say they aren't friendly with GDG files
And i forgot to add, that month by month the number of files well be bigger. I mean, if the date is January, then I'll process all 12 files of the previous year, If the date is march, then I'll process all the files from january to march, therefore my need |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2546 Location: Silicon Valley
|
|
|
|
There might be other ways to do what you want, but I think you will need to write a rexx program that issues a LISTCAT command, traps the command output, and builds a customized job. |
|
Back to top |
|
|
ojdiaz
New User
Joined: 19 Nov 2008 Posts: 98 Location: Spain
|
|
|
|
Thanks Pedro. That's what people usually do here in this client. However, since i Know that Support constantly takes all kind of files and processes them in bulk, IE, migrating all files with a specific name, i though that maybe i could acomplish something like that, but for copy
I'll keep looking into it, and if i find an answer, I'll post it here as well |
|
Back to top |
|
|
ojdiaz
New User
Joined: 19 Nov 2008 Posts: 98 Location: Spain
|
|
|
|
So, any ideas anyone? |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Write a program to grab the LISTCAT output, parses it, and builds a customized job to submit, as Pedro said. I don't think there's a whole lot of other ways to do what you want. JCL is determined when submitted so you can't change it on the fly. Therefore before you submit the job it has to have references to every file you're going to process, period. Which implies if you don't know how many files you have to process you have to run a LISTCAT to find out and then run a program to read the LISTCAT output to determine how many there are, update a template to include the ones you need to process, and generate the JCL with the correct file name(s). |
|
Back to top |
|
|
ojdiaz
New User
Joined: 19 Nov 2008 Posts: 98 Location: Spain
|
|
|
|
Thanks. That's the last solution i wanted to try. To use the listcat to get the filenames and then overwrite the jcllib. I guess that's all i can do. Thanks anyway |
|
Back to top |
|
|
Douglas Wilder
Active User
Joined: 28 Nov 2006 Posts: 305 Location: Deerfield IL
|
|
|
|
It sounds like you could start at month 1 and dynamically allocate the datasets adding 1 to the month each time until the allocate fails. |
|
Back to top |
|
|
Douglas Wilder
Active User
Joined: 28 Nov 2006 Posts: 305 Location: Deerfield IL
|
|
|
|
Would something like the following help?
Code: |
/* SAMPLE REXX TO EXECUTE DFSORT */
"FREE FI(SYSOUT SORTOUT SYSIN)"
"FREE FI(SORTIN01 SORTIN02 SORTIN03 SORTIN04 SORTIN05 SORTIN06)"
"FREE FI(SORTIN07 SORTIN08 SORTIN09 SORTIN10 SORTIN11 SORTIN12)"
"ALLOC DDNAME(SYSOUT) DSN(*)"
"ALLOC DDNAME(SORTIN01) DSN('HLQ.D200901') REUSE"
"ALLOC DDNAME(SORTIN02) DSN('HLQ.D200902') REUSE"
"ALLOC DDNAME(SORTIN03) DSN('HLQ.D200903') REUSE"
"ALLOC DDNAME(SORTIN04) DSN('HLQ.D200904') REUSE"
"ALLOC DDNAME(SORTIN05) DSN('HLQ.D200905') REUSE"
"ALLOC DDNAME(SORTIN06) DSN('HLQ.D200906') REUSE"
"ALLOC DDNAME(SORTIN07) DSN('HLQ.D200907') REUSE"
"ALLOC DDNAME(SORTIN08) DSN('HLQ.D200908') REUSE"
"ALLOC DDNAME(SORTIN09) DSN('HLQ.D200909') REUSE"
"ALLOC DDNAME(SORTIN10) DSN('HLQ.D200910') REUSE"
"ALLOC DDNAME(SORTIN11) DSN('HLQ.D200911') REUSE"
"ALLOC DDNAME(SORTIN12) DSN('HLQ.D200912') REUSE"
"ALLOC DDNAME(SORTOUT) DSN('HLQ.. . . ') REUSE"
"ALLOC DDNAME(SYSIN) DSN('HLQ.PARMLIB(MERGCOPY)') SHR REUSE"
ADDRESS LINKMVS ICEMAN
"FREE FI(SYSOUT SORTOUT SYSIN)"
"FREE FI(SORTIN01 SORTIN02 SORTIN03 SORTIN04 SORTIN05 SORTIN06)"
"FREE FI(SORTIN07 SORTIN08 SORTIN09 SORTIN10 SORTIN11 SORTIN12)" |
Where 'HLQ.PARMLIB(MERGCOPY)' contains:
Code: |
INREC BUILD=(1:1,80,81:C'1')
MERGE FIELDS=(81,1,CH,A)
OUTREC BUILD=(1:1,80)
|
This will copy any of the datasets specified that exist. |
|
Back to top |
|
|
ojdiaz
New User
Joined: 19 Nov 2008 Posts: 98 Location: Spain
|
|
|
|
Hmm... that looks interesting. However, what is REXX? I don't know or haven't worked before with something with a name like that |
|
Back to top |
|
|
Douglas Wilder
Active User
Joined: 28 Nov 2006 Posts: 305 Location: Deerfield IL
|
|
|
|
Do you have a PDS allocated to SYSEXEC or SYSPROC that you can put this into? Then on the ISPF Command line type % and the PDS member name and it will execute. It will also work to submit a batch job running TSO (IKJEFT1A) and executing the REXX. REXX are similar to CLIST but better. There is a section of this forum for CLISTS and REXX and they are very useful. It is a good thing to learn. |
|
Back to top |
|
|
|