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

File processing from PARMLIB member


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

New User


Joined: 12 Sep 2008
Posts: 51
Location: Bangalore

PostPosted: Wed Apr 21, 2010 10:58 am
Reply with quote

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

Global Moderator


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

PostPosted: Wed Apr 21, 2010 4:24 pm
Reply with quote

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

New User


Joined: 12 Sep 2008
Posts: 51
Location: Bangalore

PostPosted: Wed Apr 21, 2010 6:44 pm
Reply with quote

Hello

I use JCL, DB2 & COBOL

thank you
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: Wed Apr 21, 2010 6:51 pm
Reply with quote

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

New User


Joined: 12 Sep 2008
Posts: 51
Location: Bangalore

PostPosted: Thu Apr 22, 2010 2:52 pm
Reply with quote

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

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Thu Apr 22, 2010 3:40 pm
Reply with quote

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

New User


Joined: 12 Sep 2008
Posts: 51
Location: Bangalore

PostPosted: Thu Apr 22, 2010 4:18 pm
Reply with quote

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

Global Moderator


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

PostPosted: Thu Apr 22, 2010 5:32 pm
Reply with quote

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

New User


Joined: 12 Sep 2008
Posts: 51
Location: Bangalore

PostPosted: Thu Apr 22, 2010 6:31 pm
Reply with quote

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

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Apr 22, 2010 6:38 pm
Reply with quote

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

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Thu Apr 22, 2010 7:49 pm
Reply with quote

OK, here is some real help. You can thank me later!

The main section of your program could look like this:
  1. Open PARMLIB file.
  2. Read one line (get one dataset name)
  3. if EOF, finish process (jump to point #7)
  4. not EOF: validate file (using "perform")
  5. If file is valid, add to output process (using "perform" too)
  6. Return to point #2 to read next line.
  7. finish process: close PARMLIB file
  8. 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)
  1. Allocate the file.
  2. scan the file and set a valid/not-valid fla (using "perform" again)
  3. 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:
  1. write to output file

There is now one section left: the "scan the file" section:
  1. Open the file.
  2. set flag to "valid"
  3. Read one record.
  4. at end of file, jump to point #8
  5. Check record according to rules.
  6. if valid, proceed to next record (point #3)
  7. if not, set flag to "not-valid" and jump to point #8
  8. Close the file.
  9. 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
View user's profile Send private message
kudamala

New User


Joined: 12 Sep 2008
Posts: 51
Location: Bangalore

PostPosted: Fri Apr 23, 2010 10:26 am
Reply with quote

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

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Apr 23, 2010 7:24 pm
Reply with quote

Hello,

Quote:
some time I don't get correct flow
There is usually someone here you can "bounce ideas" off of. . . icon_smile.gif
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 FTP VB File from Mainframe retaining ... JCL & VSAM 1
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top