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

Check Point reading sequential file


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
TS70363

New User


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

PostPosted: Mon Apr 19, 2010 11:19 am
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: 94
Location: Bangalore, India

PostPosted: Mon Apr 19, 2010 4:25 pm
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
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: 271

PostPosted: Mon Apr 19, 2010 5:32 pm
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
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: 94
Location: Bangalore, India

PostPosted: Mon Apr 19, 2010 7:02 pm
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
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: 94
Location: Bangalore, India

PostPosted: Mon Apr 19, 2010 7:39 pm
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
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
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

Moderator Emeritus


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

PostPosted: Mon Apr 19, 2010 8:51 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
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
Search our Forums:

Back to Top