View previous topic :: View next topic
|
Author |
Message |
dp33770
New User
Joined: 04 Jul 2007 Posts: 91 Location: Hyderabad
|
|
|
|
I have hundreds of datasets as below
AAA.AAA.XX.XYZ
AAA.BBB.XY.XYZ
AAA.CCC.XX.XYZ
AAA.DDD.SS.XYZ
AAA.EEE.MM.XYZ
I need to run a job which will FTP all the datastet
whose the 3rd qualifier is XX or XY.
I know how to FTP the datasets.
my concern is how shall I put a check on 3rd qualifier to know whether its XX or XY. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
what is the source of your dataset names? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
is this once in a while or a continuous task ? |
|
Back to top |
|
|
dp33770
New User
Joined: 04 Jul 2007 Posts: 91 Location: Hyderabad
|
|
|
|
Dick,
These are all flat file.
What is meant by source of dataset name.
all the qualifier names are same expect one 3rd qualifier which variers.
Enrico,
This is a On Request Job ...might be quaterly once... |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
Quote: |
I have hundreds of datasets as below
|
Is the first qualifier AAA the same in all the datasets?
Quote: |
I know how to FTP the datasets. |
Are you using a JCL for that? |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Quote: |
What is meant by source of dataset name. |
Quote: |
I have hundreds of datasets as below
AAA.AAA.XX.XYZ
AAA.BBB.XY.XYZ
AAA.CCC.XX.XYZ
AAA.DDD.SS.XYZ
AAA.EEE.MM.XYZ |
That means, where does this list of "hundreds of datasets" reside? Do you have this in another dataset? |
|
Back to top |
|
|
dp33770
New User
Joined: 04 Jul 2007 Posts: 91 Location: Hyderabad
|
|
|
|
Aaru,
All the datsets Starts with AAA. All qualifiers are same except the middile two characters.
yes I m using JCL for this.
Arun,
All files are flat files and not in any PDS.
they gets created by another upstream job. |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
dp33770,
Quote: |
All files are flat files and not in any PDS.
they gets created by another upstream job. |
The question raised was, do you have the dataset-names stored somewhere? |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
dp,
Quote: |
That means, where does this list of "hundreds of datasets" reside? Do you have this in another dataset?
|
Please answer to the above ques so that we can suggest.
Anyways i do not think u can use JCL for this requirement, u can go for REXX.
Read the file incase u have all the dataset names listed in a file. Use POS and SUBSTR to get the third qualifier and check if it is equal to XX or YY. If yes then BUILD a FTP jcl with the datasets and submit it.
Even if it is not stored in a dataset, use LMDINIT to get all the datasets with ** in the third qualifier and then the above mentioned approach. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
If you use LISTCAT for at least the HLQ, does it give you a list of all of the datasets? Can you just then read that list and select only those entries that match on the 3rd qualifier. |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
Hi Superk,
Was that question for me?
I normally use LMDINIT for getting the list of datasets.
Code: |
ADDRESS ISPEXEC "LMDINIT LISTID(TEMPLIST) LEVEL("HLQ1")"
DO FOREVER
ADDRESS ISPEXEC
"LMDLIST LISTID(&TEMPLIST) OPTION(LIST) DATASET(DSVAR) STATS(YES)" |
HLQ1 - dataset name
[/quote] |
|
Back to top |
|
|
dp33770
New User
Joined: 04 Jul 2007 Posts: 91 Location: Hyderabad
|
|
|
|
All the files are generated in another upstream job as below and I know it will have the following format
AAA.BBB.XX.ZZZ
AAA.BBB.YY.ZZZ
AAA.BBB.ZZ.ZZZ
AAA.BBB.CC.ZZZ
AAA.BBB.DD.ZZZ
So when I will run my job it has to FTP datasets based on the 3rd qualifer of DSN.
Ex : If the 3rd qualifier is DD it has to FTp to differnt folder ....
If we can do it in JCL then pls let me know the process. |
|
Back to top |
|
|
|