View previous topic :: View next topic
|
Author |
Message |
kudamala
New User
Joined: 12 Sep 2008 Posts: 51 Location: Bangalore
|
|
|
|
Hello
I have a requirements as below, can anybody please help.
1. My input is PARMLIB member. It contains the list of files.
for ex: PRD.PARMLIB(MEMBER1)
MEMBER1 has the following data:
PRD.xxxx.FTP.DATA
PRD.xxxx.FTP.DATA
PRD.xxxx.FTP.DATA
Here xxxx is 4 letter code change from file to file. We don't know how many files we receive in a day and what files we receive. MEMBER1 may have 1 file or 2 files or 20 files or n files .
My task is: I need to take MEMBER1 as input and check each file inside MEMBER1 for particular data validations. If even one record in file is not qualifying my data checks, then that file should not be copied to output and only valid files should be copied to output file. Output file should contain only valid list of files.
By default MEMBER1 will be with fixed length of 80.
Files inside member will be in VB format.
Validations for ex: first 2 chars in file should be 'EC' and 3 to 6 chars should be same as 4 letter code of file.
Can anybody give some idea how to do this task. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Are you planning on writing a program to do this, or use a system utility? If the first, which programming language? If a utility, which one?
You have not provided anywhere near enough information yet for us to provide you any useful answers. |
|
Back to top |
|
|
kudamala
New User
Joined: 12 Sep 2008 Posts: 51 Location: Bangalore
|
|
|
|
Hello
I use JCL, DB2 & COBOL
thank you |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Are you planning on doing this task in COBOL? Are the FTP data files fixed length or variable length? What is their LRECL (whether fixed or variable)? |
|
Back to top |
|
|
kudamala
New User
Joined: 12 Sep 2008 Posts: 51 Location: Bangalore
|
|
|
|
Hello
Please see the answer for your questions:
Are you planning on doing this task in COBOL?
Yes, I need to use COBOL & JCL (it is batch process)
Are the FTP data files fixed length or variable length? What is their LRECL (whether fixed or variable)?
files are with Variable length and length is 597
Thanks |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
So, I guess that you will read the PARMLIB, select a dataset name, dynamically allocate that dataset, perform your check, then go back and repeat for the next dataset. |
|
Back to top |
|
|
kudamala
New User
Joined: 12 Sep 2008 Posts: 51 Location: Bangalore
|
|
|
|
Yes Kevin
you are right. But my difficulty is, to read file one by one and check the data, if data inside is not matching the criteria, even for one record, then I need to ignore that file. If the data valid for all records then I need to process the file for further actions.
Regards |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
It sounds pretty much like standard COBOL logic will work. If you have problems with the code once you've written it, let us know and we can make suggestions. However, this is a HELP forum, not a DO-YOUR-JOB-FOR-YOU forum so please do not ask for code unless you're willing to pay the professionals who respond on this forum their usual daily rate for work product (which typically is about 1000 U.S. dollars per day). |
|
Back to top |
|
|
kudamala
New User
Joined: 12 Sep 2008 Posts: 51 Location: Bangalore
|
|
|
|
Hello TANSTAAFL
Thanks for your suggestion. But I asked for help only, not for code. I asked only to know the way how we can do that....if somebody can help, that would be helpful.I was looking for logical way....
Thanks to everybody who really helped me |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
I often wonder why people can be so precise
with their indignation
about perceived slander
yet can not be bothered to refer to other posters
with their name
and instead use
an abbreviation concerning the poster's outlook on life.
kudamala,
all you have said is that you can't do it.
you have not mentioned anything about what progress you have made
nor indicated precisely where you have problems.
what is anyone to think except that you want a solution? - for free..... |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
OK, here is some real help. You can thank me later!
The main section of your program could look like this:- Open PARMLIB file.
- Read one line (get one dataset name)
- if EOF, finish process (jump to point #7)
- not EOF: validate file (using "perform")
- If file is valid, add to output process (using "perform" too)
- Return to point #2 to read next line.
- finish process: close PARMLIB file
- End of program
This should be the main body of your program.
Now, you have 2 smaller sections to take care of:
The "validate file" and the "output process" sections.
The "validate file" section could look like this:
At this time, the only thing you have is a dataset name (received from PARMLIB file)
- Allocate the file.
- scan the file and set a valid/not-valid fla (using "perform" again)
- Free the file
The "output process" section will depend very much on how you plan to copy the files.
According to this sentence (I quote) "Output file should contain only valid list of files",
you just have to write the valid dataset name:- write to output file
There is now one section left: the "scan the file" section:- Open the file.
- set flag to "valid"
- Read one record.
- at end of file, jump to point #8
- Check record according to rules.
- if valid, proceed to next record (point #3)
- if not, set flag to "not-valid" and jump to point #8
- Close the file.
- return to caller (exit)
That may be the pseudo-code that describe your requirement.
You'll need now to translate that into cobol statements...
Good luck to you! |
|
Back to top |
|
|
kudamala
New User
Joined: 12 Sep 2008 Posts: 51 Location: Bangalore
|
|
|
|
Hi Marso
Thanks a lot, this is great help. As I work alone (one member project), some time I don't get correct flow. Once again thank you so much |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
some time I don't get correct flow |
There is usually someone here you can "bounce ideas" off of. . . |
|
Back to top |
|
|
|