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
 

 

Difference between 77 and 01

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

New User


Joined: 20 Aug 2003
Posts: 2

PostPosted: Thu Aug 21, 2003 2:47 am    Post subject: Difference between 77 and 01
Reply with quote

Can anyone please give me a reply advantage of 01 single item than 77 declaration

Thanx,
Venkat
Back to top
View user's profile Send private message

mcmillan

Site Admin


Joined: 18 May 2003
Posts: 1202
Location: India

PostPosted: Thu Aug 21, 2003 8:14 am    Post subject: Re
Reply with quote

* The main Adv. is 01 items are defined in double-word boundary by default.

* Usually Global data items are declared on 01 level.

* It's better to define Linkage section variables on 01 Level.

* 01 level items have the Possibility of future enhancements over req.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Fri Aug 22, 2003 1:18 pm    Post subject:
Reply with quote

01 levels can be group level items (i.e. have 05 etc. level items below it). 77s can only be elementary level items.
Back to top
View user's profile Send private message
sandip_datta

Active User


Joined: 02 Dec 2003
Posts: 151
Location: Tokyo, Japan

PostPosted: Thu Dec 04, 2003 2:44 pm    Post subject:
Reply with quote

This question is regarding 77 and 01 level. I have a ocde like this -

01 ws-string.
05 ws-str-1 pic x(03) value 'abc'.

INSPECT WS-INPUT TALLYING WS-CNT FOR ALL WS-STR-1.

This code is giving wrong value of WS-CTR.

But when I used

77 ws-str-1 pic X(03) value 'abc' .

and same procedure division statement I am getting correct value of WS-CTR.

Please explain whether 77 and 01 level has some difference in this context or I am making some mistake in logic.

Regards,
Sandip.
Back to top
View user's profile Send private message
mdtendulkar

Active User


Joined: 29 Jul 2003
Posts: 238
Location: USA

PostPosted: Thu Dec 04, 2003 3:00 pm    Post subject:
Reply with quote

Hello Sandip,

Code:
INSPECT WS-INPUT TALLYING WS-CNT FOR ALL WS-STR-1.


WS-INPUT is the inspected data item

WS-CNT is the count field, and must be an elementary integer item defined without the symbol P in its PICTURE character-string.

WS-STR-1 is the tallying field (the item whose occurrences will be tallied).

WS-STR-1 should be one of the following:

1) An elementary alphanumeric data item
2) A DBCS data item
3) A national data item
4) A numeric data item with USAGE DISPLAY
5) An external floating-point item

This is the reason why it did not worked with a level 05 item but worked for level 77 item.

Hope this helps.

Regards

Mayuresh Tendulkar
Back to top
View user's profile Send private message
sandip_datta

Active User


Joined: 02 Dec 2003
Posts: 151
Location: Tokyo, Japan

PostPosted: Fri Dec 26, 2003 3:03 pm    Post subject:
Reply with quote

Hi Mayuresh,

Just curious....

Why WS-STR-1 should be an elementary item not a 05 level variable for good result? Please explain...and I have defined WS-CNT as a 05 level variable in my original code but it works fine...

Regards,
Sandip.
Back to top
View user's profile Send private message
RobertL

New User


Joined: 02 Jan 2004
Posts: 2
Location: Portugal

PostPosted: Fri Jan 02, 2004 10:14 pm    Post subject:
Reply with quote

Hi Sandip,

I have to admit, I'm kind of curious too. Both the 77 level and 05 level items are elementary alphanumeric data items (i.e. they both contain a PICTURE clause). AFAIK, there should be no difference between them in this context.

Can you post an example of the correct and incorrect results with the values of each field before and after?

This might help in resolving the problem.

Regards,
Robert
Back to top
View user's profile Send private message
sandip_datta

Active User


Joined: 02 Dec 2003
Posts: 151
Location: Tokyo, Japan

PostPosted: Mon Jan 05, 2004 11:33 am    Post subject:
Reply with quote

Hello Robert,

As discussed I have used following code -
Code:
.
.
.
    05  WS-INPUT          PIC X(32) VALUE 'abc def gh'.
01 WS-STRING.
    05 WS-STR-1           PIC X(03) VALUE 'abc'.

INSPECT WS-INPUT TALLYING WS-CNT FOR ALL WS-STR-1.


It is not giving incorrect value of WS-CNT.

But if I use following code -
Code:

.
.
.
    05  WS-INPUT          PIC X(32) VALUE 'abc def gh'.

01 WS-STR-1               PIC X(03) VALUE 'abc'.

INSPECT WS-INPUT TALLYING WS-CNT FOR ALL WS-STR-1.


it is giving correct result of WS-CNT = 1

Please reply.

Regards,
Sandip.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Tue Jan 06, 2004 2:19 am    Post subject:
Reply with quote

Hi Sandip,

Just curious. You don't show it in the code you supply. Do you init WS-CNT to zero before the INSPECT?

Regards, Jack.
Back to top
View user's profile Send private message
sandip_datta

Active User


Joined: 02 Dec 2003
Posts: 151
Location: Tokyo, Japan

PostPosted: Sat Jan 10, 2004 2:01 pm    Post subject:
Reply with quote

Yes I have initialized that counter also before INSPECT.
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 Difference between TWALENG and TWASIZE Arunkumar Chandrasekaran CICS 3 Tue Jan 03, 2017 12:57 pm
No new posts Sticky: difference between ... DUMMY ... and ... enrico-sorichetti JCL & VSAM 0 Mon Oct 17, 2016 4:31 pm
No new posts Difference space showed for TS and it... autobox DB2 1 Thu Apr 14, 2016 1:07 pm
No new posts Difference Between CICS WebSupport an... sachinji84 CICS 1 Mon Mar 07, 2016 7:25 pm
No new posts Difference between -180 and -181 with... deepak_shrivastava DB2 4 Wed Jan 06, 2016 10:00 am


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