• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

calling all COBOL Guruz !!!

leeland

Diamond Member
hey all
well i am having a problem with conceptualizing my program. I was hoping someone could give me some pointers.

our teacher assinged a program to take in a student input file...and a table of classes and basically figure out

the GPA (CUMM and CURR) for each student,

List their name, address, city, zip

course information ( get that from the table)



here is my problem specifically

in the file he has it layed out that there are three different record types.

so it looks like this for the data file


aaa 123456789 studentname address city state zip
bbb 123456789 #of credits currGPA
ccc coursenumber current grade

so my question is how do i set up the file descriptor for the input file. i dont think i can have rec-in for each of the aaa, bbb, ccc since that is what tells you which record you are reading.

here is what my FD looks like now...



>>FD ACOB1DAT.
>>01 STUDENT-MASTER
>> 05 REC-TYPE-A PIC X(3) VALUE SPACES.
>> 05 STU-NUM-A PIC X(9) VALUE ZEROS.
>> 05 STU-NAME PIC X(15) VALUE SPACES.
>> 05 STU-ADDRESS PIC X(15) VALUE SPACES.
>> 05 STU-CITY PIC X(15) VALUE SPACES.
>> 05 STU-CITY PIC X(11) VALUE SPACES.
>> 05 STU-STATE PIC X(2) VALUE SPACES.
>> 05 STU-ZIP PIC X(9) VALUE ZEROS.
>> 05 FILLER PIC X(15) VALUE SPACES.
>>01 CURRENT-STATUS
>> 05 REC-TYPE-B PIC X(9) VALUE SPACES.
>> 05 STU-NUM-B PIC X(9) VALUE ZEROS.
>> 05 P-COMP-CREDITS PIC X(3) VALUE ZEROS.
>> 05 P-POINTS PIC X(3)V9 VALUE ZEROS.
>> 05 FILLER PIC X(64) VALUE SPACES.
>>01 COURSE-GRADE
>> 05 REC-TYPE-C PIC X(3) VALUE SPACES.
>> 05 STU-NUM-C PIC X(9) VALUE ZEROS.
>> 05 DEPT-CODE PIC X(3) VALUE SPACES.
>> 05 COURSE-NUM PIC X(3) VALUE ZEROS.
>> 05 GRADE PIC X(1) VALUE ZEROS.
>> 05 FILLER PIC X(55) VALUE SPACES.


so i don't know how to search the file to get the specific info for the output

should i use an if statement like this ???

if rec-type-a is = to 'aaa'
move name to name-out
.
.
.

if rec-type-b is = to 'bbb'
blah blah blah


and move things where i need them like that ???




sorry for the long ass post but all help is appreciated

leeland
 
Back
Top