FUNCTION MAX

This is a Mainframe COBOL forum - you can post your queries on Mainframe COBOL, VS COBOL II, COBOL/370 , Enterprise COBOL

Moderators: dbzTHEdinosauer, Moderator Group

Post Reply
hariprasdkc
Member
Posts: 10
Joined: Fri May 08, 2009 11:55 am

FUNCTION MAX

Post by hariprasdkc » Fri Jun 12, 2009 11:45 am

What will b the result of the following,

Code: Select all

 01 NICKNAME   PIC X(11). 
01 DATA-FIELDS. 
   05 FLDA PIC X(11) VALUE 'SNOOKIEPOOH'. 
   05 FLDB PIC X(11) VALUE 'SNOOKIEbbbb'. 
   05 FLDC PIC X(11) VALUE 'WOOKIEbbbbb'. 
   05 FLDD PIC X(11) VALUE 'WICKIEWOCKb' 
... 
MOVE FUNCTION MAX(FLDC FLDA FLDB FLDD) TO NICKNAME (1:11).  
Will cobol see the left most character's collating sequence or..?
Does it return FLDC or FLDD.. to NICKNAME..?

User avatar
dbzTHEdinosauer
Moderator
Posts: 981
Joined: Mon Oct 02, 2006 8:31 pm

Post by dbzTHEdinosauer » Fri Jun 12, 2009 2:39 pm

Since you obviously don't have access to COBOL manuals,
here is a link to the COBOL manual for the MAX function

why would you think the contents of FLDD would be returned??????
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.

hariprasdkc
Member
Posts: 10
Joined: Fri May 08, 2009 11:55 am

Post by hariprasdkc » Fri Jun 12, 2009 5:17 pm

FLDC is the answer.

User avatar
dbzTHEdinosauer
Moderator
Posts: 981
Joined: Mon Oct 02, 2006 8:31 pm

Post by dbzTHEdinosauer » Fri Jun 12, 2009 5:23 pm

yes, it is the contents of FLDC.
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others