Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Cobol program for checking existence of a file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
soumen pal

New User


Joined: 07 Aug 2007
Posts: 6
Location: kolkata

PostPosted: Wed Nov 28, 2007 3:04 pm    Post subject: Cobol program for checking existence of a file
Reply with quote

Is it possible to write a program in cobol or easytrieve which checks whether a file exists or not and if exists zip that file?
Back to top
View user's profile Send private message

murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Wed Nov 28, 2007 3:09 pm    Post subject:
Reply with quote

soumen,

Quote:
which checks whether a file exists or not

Why not thru JCL?
Back to top
View user's profile Send private message
soumen pal

New User


Joined: 07 Aug 2007
Posts: 6
Location: kolkata

PostPosted: Wed Nov 28, 2007 3:26 pm    Post subject:
Reply with quote

Actually, in the existing system,it is being done thru JCL,but for each file,2/3 control members are being used...instead of using controls for each and every file,is it not a better option to use a single program...i m not sure whether this is a good option or not...suggest me is it feasible or not...
Back to top
View user's profile Send private message
superk

Moderator Team Head


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

PostPosted: Wed Nov 28, 2007 3:30 pm    Post subject: Reply to: Cobol program for checking existence of a member
Reply with quote

Could you clarify something.

In your title, you say that you want a process "for checking existence of a member", but in the post you say you want a process that "checks whether a file exists or not".

Which is it?
Back to top
View user's profile Send private message
soumen pal

New User


Joined: 07 Aug 2007
Posts: 6
Location: kolkata

PostPosted: Wed Nov 28, 2007 3:45 pm    Post subject:
Reply with quote

Sorry! Here is what I intend to do -

1. Check whether a particular dataset (flat file not member) exists
2. Zip that dataset
3. Send it to a mailbox.

Currently there are 15 such datasets. A single process on a single dataset means I need to write 3 control members (corresponding to the steps above). Going forward I fear there will be 100 more datasets to come and this no. will increase almost forever.

I am currently doing it thru JCL

I need a program or a single JCL step to replace the existing steps. The program will read a file (flat file) that contains the file name and the mailbox id. It then does all the checking and sends the dataset to the appropriate mailbox. The program then goes on to the next line of the input file to read the next dataset and the whole process is repeated until the input file is exhausted.

Hope this helps!
Back to top
View user's profile Send private message
superk

Moderator Team Head


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

PostPosted: Wed Nov 28, 2007 7:09 pm    Post subject: Reply to: Cobol program for checking existence of a file
Reply with quote

Let me start off by stating that, for what you want to do, it seems to me that writing the program in REXX would be both easier and probably more
efficient. SAS would probably work well too. I don't know anything about Easytrieve to comment on using it.

That being said, I don't see anything in your process that should be a problem and that hasn't already been discussed before:

1. Check whether a particular dataset (flat file not member) exists.

This, of course, requires a call to the IDCAMS LISTCAT command, as has been documented many times over in these forums. Yes, you can call IDCAMS in COBOL. Or, you can setup a TSO environment in COBOL and use the TSO LISTCAT or TSO LISTDS commands instead.

2. Zip that dataset.

If you can invoke PKZIP as a command or call it from an API, then I don't see an issue there.

3. Send it to a mailbox.

Don't know what you mean by this exactly. I doubt it'll be a problem.
Back to top
View user's profile Send private message
dick scherrer

Site Director


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

PostPosted: Wed Nov 28, 2007 9:35 pm    Post subject:
Reply with quote

Hello,

You might consider writing a cobol program that dynamically creates the 3 "control members". The currently working process would then simply use the newly created members.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Full Time COBOL Software Development ... shally Mainframe Jobs 0 Fri Jan 20, 2017 5:24 am
This topic is locked: you cannot edit posts or make replies. COBOL Software Development Lead at Fi... shally Mainframe Jobs 0 Fri Jan 20, 2017 5:21 am
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm
No new posts OO COBOL compile error Virendra Shambharkar COBOL Programming 3 Tue Jan 10, 2017 6:05 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us