View previous topic :: View next topic
|
Author |
Message |
kudamala
New User
Joined: 12 Sep 2008 Posts: 51 Location: Bangalore
|
|
|
|
Hello
I have a requirement and it is as follows:
I receive 'N' number of files everyday and at the end of the day I need to concatenate them into one file and need to update the DB2. The file format would be like, PRD.FILE.xxxx.FTP.DATA. Where xxxx would be vendor code. We have around 1000 vendors. But daily I get only a few vendor files for processing. Like
PRD.FILE.ven1.FTP.DATA
PRD.FILE.ven2.FTP.DATA...... may be 10 or 20 or 30 files a day. But that number is not known and vendor also not known.
Can anybody help, how can I pickup the available files for the day for processing in my JCL?
Thanks in advance |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
Back to top |
|
|
kudamala
New User
Joined: 12 Sep 2008 Posts: 51 Location: Bangalore
|
|
|
|
Hello Kevin
Thanks for your suggestion. I have looked into the topic mentioned by you. But it is related to GDG and we know the file name. But in my case its a flat file and each file name is different. Do you think that this works with LISTCAT?
Thanks & Regards |
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1745 Location: Tirupur, India
|
|
|
|
Hi,
The IDCAMS LISTCAT works for flatfiles as well.
Remove the GDG keyword alone on the LISTCAT statement.
Quote: |
But in my case its a flat file and each file name is different. |
try this command,
LISTCAT ENT('PRD.FILE.*.FTP.DATA') ALL
As shown on the thread by Kevin,
You will have to edit the SORT cards to filter out the dataset names alone created for the current day.
hope this helps |
|
Back to top |
|
|
kudamala
New User
Joined: 12 Sep 2008 Posts: 51 Location: Bangalore
|
|
|
|
Hello Vasanth & Kevin
Thanks a lot for your help. It works fine. |
|
Back to top |
|
|
kudamala
New User
Joined: 12 Sep 2008 Posts: 51 Location: Bangalore
|
|
|
|
Hello
Again, using LISTCAT ENT, I am getting all the datasets, but also other statistics. If I want to have only the name of the datasets without any other information, is is possible? Do we have any option with LISTCAT?
Thanks in advance |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
At least post what your control statements look like, and also the output.
Please also post the output you require.
Have you bothered to read the IDCAMS manual to see if the various options might help you.
What else have you tried for yourself, possibly adapting the sort include / omit criteria. |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
Just remove the "ALL" parameter!
Use your free time to click on "IBM Manuals" on top of this page, scroll down to "Tools & Data Access methods" section,
and click on VSAM Services for DFSMS link.
Chapter 27 explains all the parameters for LISTCAT |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Hi Marso,
Methinks that the OP gets the info he wants but not in the correct format, hence my comment relating to the linked thread suggesting a play with the sort control statements.
I know it can be done easily as I have done this myself a couple of times. |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
kudamala wrote: |
I receive 'N' number of files everyday and at the end of the day I need to concatenate them into one file |
kudamala wrote: |
Again, using LISTCAT ENT, I am getting all the datasets, but also other statistics. If I want to have only the name of the datasets without any other information, is is possible? Do we have any option with LISTCAT? |
Even without the ALL parameter, some cleanup will be necessary:
Code: |
TSO LISTC ENT('HLQ.*.COBOL)
NONVSAM ------- HLQ.TST1.COBOL
IN-CAT --- CATALOG.USER.PROD0000
NONVSAM ------- HLQ.TST2.COBOL
IN-CAT --- CATALOG.USER.PROD0000
NONVSAM ------- HLQ.PROD.COBOL
IN-CAT --- CATALOG.USER.PROD0000 |
Supposing that you have successfully collected a list of dataset names, how do you plan to concatenate them ??? |
|
Back to top |
|
|
kudamala
New User
Joined: 12 Sep 2008 Posts: 51 Location: Bangalore
|
|
|
|
Hi
Yes, what you said is correct. We need some clean up. I tried to sort using outrec, but I couldn't succeed. Can anybody provide correct sort code to copy only dataset names to output file from the above file?
Thanks in advance |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Please provide your sort code and we will try to help you. |
|
Back to top |
|
|
kudamala
New User
Joined: 12 Sep 2008 Posts: 51 Location: Bangalore
|
|
|
|
Hello
Here is what I use.
//SORTIN DD DSN=DEV.EUM.SELL.LIST.DATA0,DISP=SHR
//SORTOUT DD DSN=DEV.EUM.SELL.LIST.DATA,DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,SPACE=(TRK,(150,150),RLSE),
// RECFM=VB,
// LRECL=125
Sort card:
SORT FIELDS=COPY
OUTREC FIELDS=(5:23,40)
Input data:
=COLS> ----+----1----+----2----+----3----+----4----+--
****** ***************************** Top of Data *****
000001 0NONVSAM ------- DEV.EUM.MKT.SELL.ABCD.FTP.DATA
000002 0NONVSAM ------- DEV.EUM.MKT.SELL.ALCK.FTP.DATA
000003 0NONVSAM ------- DEV.EUM.MKT.SELL.BCDA.FTP.DATA
000004 0NONVSAM ------- DEV.EUM.MKT.SELL.ARPD.FTP.DATA
Error:
ICE201I E RECORD TYPE IS V - DATA STARTS IN POSITION 5
ICE150I 0 VLSHRT NOT USED FOR SORT, MERGE, INCLUDE, OMIT OR SUM STATEMENT
ICE126A 0 INCONSISTENT *OUTREC IFTHEN 0 REFORMATTING FIELD FOUND
Both input and output files are in VB format. What I need is to copy only file names from input to out.
thanks in advance |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
This is what works for me, getting the output into an FB 80 dataset
Also, I do not try and override the DCB parameters from the LISTCAT, I let it use VBA, 125
Code: |
//SORTOUT DD DSN=Data Set Name,DISP=(,CATLG,DELETE),
// RECFM=FB,LRECL=80,SPACE=(TRK,(3,3),RLSE)
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL INCLUDE=(6,7,CH,EQ,C'NONVSAM'),
OUTREC=(22,44,80:X),VTOF |
|
|
Back to top |
|
|
kudamala
New User
Joined: 12 Sep 2008 Posts: 51 Location: Bangalore
|
|
|
|
Thank you all
It works with the above parameters. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
For such an exercise I usually prefer using (gives rather neat output):
Code: |
//STEP01 EXEC PGM=IKJEFT1A
//SYSPROC DD DSN=SYS1.SAMPLIB,DISP=SHR
//SYSTSPRT DD DSN=XXXXXX.LIST.HLQ,
// DISP=(NEW,CATLG,CATLG),
// UNIT=??,SPACE=??,
// DCB=(RECFM=FB,LRECL=133,BLKSIZE=0)
//SYSTSIN DD *
%IGGCSIRX
HLQ.**
/* |
Though I just figured it out, it does not work for search-argument of type "HLQ.**.LLQ" but it works for "HLQ.S**.LLQ" where "S" can be replaced by your choice. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Huh, it certainly works for me.
What results are you getting. My CSI utility works fine with HLQ.**.LLQ
Of course it may be my interpretation of what you are saying Anuj, as it has been one of THOSE DAYS.
Is it legal to shoot users ? |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
ah..My observation sucks - take my words back . Why the hell do I work on Thrusday and now idiots have asked me to give support on coming Sunday while for that day my ex is waiting to meet Her on Her B'day ... my timing stinks!Yuck!
Quote: |
Is it legal to shoot users ? |
Sorry but 'm lost here, expat. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
expat wrote: |
Is it legal to shoot users ? |
Only when they are in season, expat. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Anuj Dhawan wrote: |
Quote: |
Is it legal to shoot users ? |
Sorry but 'm lost here, expat. |
What I was saying here, and you must have had the experience, is when your users do things so stupid that you feel they are so dense that light bends toward them, so I was just asking if it was legal to shoot the users so I don't have to sort out their stupid problems. Just to put your mind at ease here, I WAS NOT referring to you ....... no really, honestly I mean it
Robert, When does user season open up |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
expat, some days I think the season should be year-round ..... |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
LOL - expat, you know this kid now quite well... |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Anuj Dhawan wrote: |
LOL - expat, you know this kid now quite well... |
And if you ever come to Brussels the first beer (or nine) is on me |
|
Back to top |
|
|
|