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
 

 

How to Initialize a File, given in Input, using JCL ?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Tue Mar 13, 2007 11:47 am    Post subject: How to Initialize a File, given in Input, using JCL ?
Reply with quote

Hi,

Is there any way in JCL, using which I can initialize a file given in input.

Please don't mix empty-file & Initialized-file with each other.

Let me explain:
I have a file,say HLQ.FIRST.FILE & it contains 10 records.

Now, definition of
Empty File: When I say above file is empty then there is no record in the file.One can say I open the file in edit mode & used D9999 (Deleted all the records).

Initialize File: There is one record in the file in which all Numerical fields are Zeros & Alphanumeric Fields are SPACES.


Actually to Initialize a file One has to know the Layout of the file, but
I was trying to make a general JCL.

Using COBOL I have one Idea, will write two COBOL programs
Say PGM1 & PGM2. PGM2 will be called module.

PGM1 will have the input file to be initialize, will pass the Name of file
HLQ.FIRST.FILE to PGM2(here agian I've to think how to pass the name of Data Set),which will unstring it; based on one of un-stringed string it will search a Data-lib for the copybook for this file. This copybook will be passed to PGM1 in which Output record will be redefined with this copybook.
Now, I have the layout, will initialize the First Group level Variable.Hopefully my file will be initialized.

But it's a bit tedious job, isn't there any way through JCL..?


Please advise.
Back to top
View user's profile Send private message

ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Tue Mar 13, 2007 1:56 pm    Post subject:
Reply with quote

Quote:
But it's a bit tedious job, isn't there any way through JCL..?

JCL is a Job Control Language, not a programming language. Your mission is totally programmatic.

O.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Tue Mar 13, 2007 6:26 pm    Post subject:
Reply with quote

Yeah, do agree..!!

Actually, using IDCAMS or IEBGENER we can Empty the file given in the input, so I just come up with a thought that ..perhaps there is some way using which I can Initialize a file using JCL, so asked the above query.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Tue Mar 13, 2007 7:20 pm    Post subject:
Reply with quote

The whole concept of having a file with one record that has been "initialized" to zeroes and spaces is really strange.
What use would that "initialized" record be?
A file should contain data, not a single empty record.
Again I ask, what would be its use?
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: Tue Mar 13, 2007 8:50 pm    Post subject:
Reply with quote

Hello,

Do you actually need an "empty" record? Are you trying to ensure that when read, the first read goes to successful end-of-file?

To create an empty file you can do with JCL.

As Bill asked - how would you use a file with one "empty" record?
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Tue Mar 13, 2007 9:00 pm    Post subject:
Reply with quote

William,

Yeah, it's a very specific need.

In System/Integration cycle phase of projects (specificaly in first System-Cycle run), I need some control Reports(which are used for Balancing purpose by one third party JOBs) in initialized state.

Say, there are 2 systems sys1 & sys2. I work for sys2 & it's a downstream for sys1.

if I want to do my testing independent of sys1, then for this purpose I copy the required input from production & will manipulate according to my needs instead of getting file from sys1.But if sys1 has to be involved then I need files in initialized status, coz third party JOBs will abend with an empty file. Let me explain:

Lets asuume I work for such a system in which I have to keep track on some amounts & counts. For this, in production, sys1 sends a Control Report (say CRep1) containing some amounts & counts to sys2; now after processing the files form sys1, sys2 will generate one more Control Report (say CRep2), before sending the data to downstreams.
Now the third party JOBs will pick the above two reports CRep1 & CRep2 & will cross-validate whether the amounts/counts passed from sys1 are in sync after sys2..if not an abend is there.


Consider one more situation, in which I say I have two data bases in my system one is pending & other is paid.

PENDING are those who must not be paid in today cycle run.
PAID are those who must be paid in today cycle run.

Now for cycle run, I have to keep CRep2 initialized to make JOBs to feel as if the Pending amounts/counts are zero, coz my motive is to make all the records to go in Paid Data base with out any balancing abend.
Because I want to run my first cycle so there is no logical yesterday from cycle point of view..so nothing must be in pending.

There are some 20-25 such Control Reports for a particular project & when 2 or 3 projects runs parallely then there are enough files to be initialized, so I asked the above query.

I hope ..I could expalin why I need an initilazed file.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Wed Mar 14, 2007 5:43 pm    Post subject:
Reply with quote

Please provide some inputs..!
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am
No new posts File processing vishwakotin Mainframe Interview Questions 9 Fri Apr 28, 2017 11:38 am


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