View previous topic :: View next topic |
Author |
Message |
tattva Beginner
Joined: 02 Feb 2005 Posts: 97 Topics: 36
|
Posted: Mon May 02, 2005 6:42 pm Post subject: GDG version (0) |
|
|
Hi folks,
i have program which takes the (0) version of the GDG and creates (+1) version of the same GDG.
The program abends if the (0) is empty.
Now my question is :-
1) say i create a new GDG base and run this program . .shudnt this program abend !!!
2) If my above statement is TRUE. then every version of that GDG should be empty !!
Please correct me if i'm wrong !!
Thanks,
Tattva |
|
Back to top |
|
 |
Dibakar Advanced

Joined: 02 Dec 2002 Posts: 700 Topics: 63 Location: USA
|
Posted: Mon May 02, 2005 11:32 pm Post subject: |
|
|
I will guess that first version was already present when the program was run. |
|
Back to top |
|
 |
s_shivaraj Beginner

Joined: 21 Sep 2004 Posts: 140 Topics: 14 Location: Chennai, India
|
Posted: Mon May 02, 2005 11:43 pm Post subject: |
|
|
Tattva,
Quote: | 1) say i create a new GDG base and run this program . .shudnt this program abend !!!
|
Yes, The program will abend because 0 version is not present.
Quote: | 2) If my above statement is TRUE. then every version of that GDG should be empty !!
| Creating a GDG, it doesnt mean that u r creating a file(i.e a version of a GDG ) , so you need to create a version of a GDG to use it
Hope i answered ur quesions, _________________ Cheers
Sivaraj S
'Technical Skill is the Master of complexity, while Creativity is the Master of Simplicity' |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Tue May 03, 2005 7:49 am Post subject: |
|
|
Quote: |
The program abends if the (0) is empty.
|
Tattva,
Handling of empty file should be coded in the program. The logic is pretty simple.
Code: |
00000-MAINLINE.
PERFORM 10000-INITIALIZE
PERFORM 20000-MAIN-PROCESS UNTIL S-INPUT-EOF = 'Y'
PERFORM CLOSE-FILES
GOBACK
.
10000-INITIALIZE.
******************************************************************
* THIS PARAGRAPH IS PERFORMED TO PROCESS THE OPENING OF FILES, *
* INITIALIZING ALL WORKING STORAGE COUNTERS, AND PRIME READ THE *
* INPUT FILES. *
******************************************************************
PERFORM OPEN-FILES
PERFORM INITIALIZE-COUNTERS
PERFORM READ-INPUT-FILE
.
20000-MAIN-PROCESS.
*****************************************************************
* THIS PARAGRAPH IS THE MAIN PROCESS *
*****************************************************************
YOUR MAIN PROCESS LOGIC
30000-READ-LABEL-FILE.
*****************************************************************
* THIS PARAGRAPH IS PERFORMED TO READ THE INPUT FILE *
*****************************************************************
READ INPUT-FILE
AT END
MOVE 'Y' TO S-INPUT-EOF
NOT AT END
ADD +1 TO A-INPUT-RECS-READ
END-READ
.
|
Hope this helps...
Cheers
kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
|
|