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
 

 

Check Point reading sequential file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
View previous topic :: :: View next topic  
Author Message
TS70363

New User


Joined: 07 Apr 2010
Posts: 93
Location: Bangalore, India

PostPosted: Mon Apr 19, 2010 11:19 am    Post subject: Check Point reading sequential file
Reply with quote

Hi all,

In a recent interview, I was asked--

1) A COBOL module is reading a flat file containing some 1000 records and writing those 1000 records in some differently arranged form in a new file.

Say, suppose my program abends somewhere in the middle while reading the 499th record.

Tell me the logic to start the program from where it abended.....

2) Can we retain the value of working storage variable once the program is over?????



Answer : 1) As it is flat file, we need to read the records from the beginning..We cannot skip the records or any I/O read operation.

2) NO we cannot retain the value of the working storage variable in COBOL. But if it is a CICS then it is possible..
Back to top
View user's profile Send private message

TS70363

New User


Joined: 07 Apr 2010
Posts: 93
Location: Bangalore, India

PostPosted: Mon Apr 19, 2010 4:25 pm    Post subject:
Reply with quote

Please let me know if I am correct....
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Mon Apr 19, 2010 4:53 pm    Post subject:
Reply with quote

1. though a qsam file by definition must be read sequentially, if you kept track of the number of records you process, and save this count in another file, you could skip those records already processed during your restart.

2. you can write your working-storage values to either db2 or a file during your processing.

so, I would say that you are not correct.
I would also suggest googling - RESTART Checkpoint processing and
do a little reading.
Back to top
View user's profile Send private message
pkmurali
Warnings : 1

Active User


Joined: 15 Dec 2005
Posts: 236

PostPosted: Mon Apr 19, 2010 5:32 pm    Post subject:
Reply with quote

Quote:

though a qsam file by definition must be read sequentially, if you kept track of the number of records you process, and save this count in another file, you could skip those records already processed during your restart.


How to Skip the records in Sequential File -Read? Even i am having the count value how to read & skip those records of sequential files?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Mon Apr 19, 2010 5:39 pm    Post subject:
Reply with quote

the word SKIP is to apply to
process
and not read.
Back to top
View user's profile Send private message
TS70363

New User


Joined: 07 Apr 2010
Posts: 93
Location: Bangalore, India

PostPosted: Mon Apr 19, 2010 7:02 pm    Post subject: Reply to: Check Point reading sequential file
Reply with quote

Quote:
1. though a qsam file by definition must be read sequentially, if you kept track of the number of records you process, and save this count in another file, you could skip those records already processed during your restart.



Can you just brief out on this topic...

Let us assume my job abended when reading the 498th record and next time I start my job, my program should start reading the input file from 498th record.

How do we accomplish this programmatically.
I am not sure how to skip read statement for a sequential file.

Please post the code if possible or atleast some syntax
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Mon Apr 19, 2010 7:07 pm    Post subject:
Reply with quote

count-of-process-records is a field contained in the checkpoint restart record for the program.

Before starting your normal processing logic:

if count-of-process-records = 0, that means there is no restart processing to perform.

if count-of-process-records > 0, that means the program blew up on record number ?

Code:
IF count-of-process-records > 0
THEN
    PERFORM count-of-process-records TIMES
                READ ...
    END-PERFORM
END-IF


PERFORM NORMAL PROCESSING LOGIC

Keep in mind, if you have an output file, you need to have a disposition of MOD.
Back to top
View user's profile Send private message
TS70363

New User


Joined: 07 Apr 2010
Posts: 93
Location: Bangalore, India

PostPosted: Mon Apr 19, 2010 7:39 pm    Post subject:
Reply with quote

This means that we still need to perform read operation for count-of-process-records number of times.

So any how we cannot skip the records..
We are reading them but doing nothing with the number of processed records.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Mon Apr 19, 2010 8:00 pm    Post subject:
Reply with quote

I apologize for my bad verbiage.

those of use with english as a first language understand the meaning of skipping in this context,
but when the computer meaning of skip is applied, the definition/meaning is different.

again, the term skip only referred to the process.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Mon Apr 19, 2010 8:25 pm    Post subject:
Reply with quote

Additionally,
I have never worked at a shop that did not have some type of standard restart procedure.

This is especially true if you work for an outsourcing firm.

I would suggest that you obtain and read all documentation concerning standards at your organization or the organization that you are supporting.
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: Mon Apr 19, 2010 8:51 pm    Post subject:
Reply with quote

Hello,

FWIW- restart is not usually done for a process that only reads a sequential file and writes another. . . Actually, i've never seen this.

As DBZ mentions, organizations that use restart/recovery have a process in place and any new processes that need to be restarted should use the existing standard method.

With the newer/faster dasd and cpus, many places no longer implement restart processes. In the rare case where there is a re-startable abend, total down-time is less by simply rerunning from the beginning. . .
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 -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 2 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 4 Fri Mar 24, 2017 11:51 am
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts Check Binary Values for symbols gandikk CA Products 3 Tue Mar 21, 2017 5:11 am
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm


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