Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Migration help with old cobol standards

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
shankarm

Active User


Joined: 17 May 2010
Posts: 175
Location: India

PostPosted: Sun Nov 13, 2011 9:34 pm    Post subject: Migration help with old cobol standards
Reply with quote

Hello,

Curretly am working on a code change, the cobol modulewas written in1985.

when i try to compile the module, compiler is throwing an error.

Code:

WRITE PRINT-RECORD     AFTER POSITIONING PR-CC.


in the above code, what does 'positioning pr-cc' mean? lastest cobol compiler is not recognizing this key-word.

Code:

******  BYPASS DUMMY RECORD   ********
     ON  1                           
         GO TO 100-READ-STATUS-FILE. 
**************************************


in the above code what does 'ON 1' mean?

when i compile the program, error was thrown and these keywords are not recognized.

can you please explain about these key words? so that i can replace these with the latest key words and run the program.
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: Sun Nov 13, 2011 10:30 pm    Post subject:
Reply with quote

Hello,

PR-CC is for "carriage control" or to control the spacing of the report down the page. Using a variable is still acceptable, but i have not seen POSITIONING for a long time. You would be ahead to switch to ADVANCING.

The ON statement has been removed from the language. This was often used as a "first-time" switch/indicator. You can accomplish the same thing with a counter or a variable (i.e MY-FIRST-TIME) that is initialized to Y abd set to N after the first pass thru the code.
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: Sun Nov 13, 2011 10:32 pm    Post subject:
Reply with quote

Follow on:

At the top of the page is a link to "IBM Manuals". As there are several versions of COBOL available, suggest you become familiar/comfortable with the Language Reference (and Programming Guide) for your release of the COBOL compiler. Lots has changes in 25+ years. . .
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Mon Nov 14, 2011 1:30 am    Post subject: Reply to: old cobol standards
Reply with quote

You have a 26-year-old Cobol program. It may well be protected by UNESCO, under their program to preserve languages. Check before updating :-)

That was a joke, before you start looking-up (or asking here) how to contact UNESCO.

It seems fun that for 26 years the program has been ignoring the "dummy record" that is the first on the file. Might be worth checking that out, perhaps the dummy is not needed and you can drop it off in an authorised manner. Worse would be if a genuine record has been irnored every day but one for the last 26 years. Mrs Scroggins, your oldest customer, has been waiting for delivery of her curling tongs a long time..

Not missing WRITE PROCEEDING at all.

ON though, was a cutie. We were reminiscing in August about this.

ON 1s were widespread for "first time switches" in called programs. You don't have to define any data, you don't have to do any counting, it was all automatic. All you had to do what remember the full-stop/period (no such construct as END-ON).

To let it rip to its full extent, ON can be accompanied by AND EVERY... UNTIL. ON 1 AND EVERY 1 UNTIL 10 would do the stuff before the period/fullstop 10 times. If you had more than one ON in a program, the compiler kept track of seperate counts for you, so both/all could be ON 1. If you wanted to find the value in the particular counter, you hunt down the displacement of the ONCNTL CELLS (or ONCTL, ONCTRL, something similar). Useful for quick-and-dirtys, avoided in real work except that first-time-switch.

I was first thing that maybe you'e found a gem of a program. But, maybe not. ON 1 GO TO to identify and ignore a "dummy" record in production strikes me as a horrible accident waiting to happen (when someone removes the dummy record, but not the dumb code).

Fingers crossed for you. You find any TRANSFORMs or EXAMINEs? We also covered EXHIBIT fairly recently.

I don't know why they were dropped. Yes I do. Make the code more portable when heading off the mainframe. Seems contradictory, but there you go (to).
Back to top
View user's profile Send private message
Ronald Burr

Active User


Joined: 22 Oct 2009
Posts: 293
Location: U.S.A.

PostPosted: Mon Nov 14, 2011 5:15 am    Post subject:
Reply with quote

'AFTER POSITIONING' caused the program to create files with the 'M' attribute (e.g. FBM) rather than the 'A' attribute (e.g. FBA). The 'M' meant that "Machine" code was to be used for carriage control.

To convert 'AFTER POSITIONING' to 'AFTER ADVANCING'
First insure that your JCL reflects attribute 'M' instead of 'A' in the RECFM for the file wherever it is specified (if specified).
Then, replace the single WRITE statement with the following (or its equivalent):

Code:
EVALUATE PR-CC
  WHEN '1'
    WRITE PRINT-RECORD AFTER ADVANCING PAGE
  WHEN SPACE
    WRITE PRINT-RECORD AFTER ADVANCING 1 LINE
  WHEN '0'
    WRITE PRINT-RECORD AFTER ADVANCING 2 LINES
  WHEN '-'
    WRITE PRINT-RECORD AFTER ADVANCING 3 LINES
END-EVALUATE


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

Senior Member


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

PostPosted: Mon Nov 14, 2011 5:01 pm    Post subject:
Reply with quote

Quote:
in the above code what does 'ON 1' mean?

http://ibmmainframes.com/about32786.html
http://ibmmainframes.com/post-60005.html
Back to top
View user's profile Send private message
shankarm

Active User


Joined: 17 May 2010
Posts: 175
Location: India

PostPosted: Mon Nov 14, 2011 7:16 pm    Post subject:
Reply with quote

Thanks everyone for you time.
I will refer the manuals and if i find something new(other than what is discussed here), i will update you guys.
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 Nov 14, 2011 9:35 pm    Post subject:
Reply with quote

Hello,

Quote:
if i find something new
There are many "new" things since the compiler that was used 25 years ago. . . icon_wink.gif
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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts IEW2456E error when link-editing a C ... Senthilraj JCL & VSAM 0 Fri Oct 13, 2017 3:12 pm
No new posts Assembler Macro Copybook converted to... Ziquilix PL/I & Assembler 4 Tue Sep 26, 2017 3:07 am
This topic is locked: you cannot edit posts or make replies. Extract all "IF" Statements... Adarsh Damodaran CLIST & REXX 1 Wed Sep 06, 2017 9:28 am
No new posts ALPHABETIC check in COBOL vidyaa COBOL Programming 8 Thu Aug 17, 2017 7:13 pm
No new posts XML Parse for COBOL 5.2 Bhanu Praveen COBOL Programming 1 Sat Jul 08, 2017 8:58 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us