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

Procesing Several files at the Same time?


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ojdiaz

New User


Joined: 19 Nov 2008
Posts: 98
Location: Spain

PostPosted: Thu Apr 30, 2009 5:28 pm
Reply with quote

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 icon_redface.gif . I hope that made sense

Thanks in Advance

Oliver
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Thu Apr 30, 2009 5:35 pm
Reply with quote

Have you considered GDGs?
Back to top
View user's profile Send private message
ojdiaz

New User


Joined: 19 Nov 2008
Posts: 98
Location: Spain

PostPosted: Thu Apr 30, 2009 5:42 pm
Reply with quote

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 icon_neutral.gif
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2546
Location: Silicon Valley

PostPosted: Thu Apr 30, 2009 9:02 pm
Reply with quote

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
View user's profile Send private message
ojdiaz

New User


Joined: 19 Nov 2008
Posts: 98
Location: Spain

PostPosted: Thu Apr 30, 2009 10:05 pm
Reply with quote

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
View user's profile Send private message
ojdiaz

New User


Joined: 19 Nov 2008
Posts: 98
Location: Spain

PostPosted: Sat May 02, 2009 8:44 pm
Reply with quote

So, any ideas anyone?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Sat May 02, 2009 8:53 pm
Reply with quote

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
View user's profile Send private message
ojdiaz

New User


Joined: 19 Nov 2008
Posts: 98
Location: Spain

PostPosted: Sun May 03, 2009 8:03 pm
Reply with quote

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
View user's profile Send private message
Douglas Wilder

Active User


Joined: 28 Nov 2006
Posts: 305
Location: Deerfield IL

PostPosted: Mon May 04, 2009 8:42 pm
Reply with quote

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
View user's profile Send private message
Douglas Wilder

Active User


Joined: 28 Nov 2006
Posts: 305
Location: Deerfield IL

PostPosted: Thu May 07, 2009 9:45 pm
Reply with quote

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
View user's profile Send private message
ojdiaz

New User


Joined: 19 Nov 2008
Posts: 98
Location: Spain

PostPosted: Mon May 18, 2009 6:04 pm
Reply with quote

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
View user's profile Send private message
Douglas Wilder

Active User


Joined: 28 Nov 2006
Posts: 305
Location: Deerfield IL

PostPosted: Tue May 19, 2009 6:45 am
Reply with quote

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
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 Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
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 Merge two VSAM KSDS files into third ... JCL & VSAM 6
Search our Forums:

Back to Top