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
 

 

Information About API

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS
View previous topic :: :: View next topic  
Author Message
Kishore Chebrolu

New User


Joined: 24 Jan 2011
Posts: 1
Location: Chennai

PostPosted: Thu Apr 28, 2011 6:31 pm    Post subject: Information About API
Reply with quote

What is an API? And how it will work? What is the Difference Between an API and SubProgram?
Could you please Help on this Questions.

--
Sairam
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7931
Location: Bellevue, IA

PostPosted: Thu Apr 28, 2011 6:42 pm    Post subject:
Reply with quote

Application Programming Interace

Google is your friend. Googling api returns about 529,000,000 results and the very first one tells you what an API is.
Back to top
View user's profile Send private message
Jose Mateo

Active User


Joined: 29 Oct 2010
Posts: 110
Location: Puerto Rico

PostPosted: Fri Apr 29, 2011 12:31 am    Post subject:
Reply with quote

Good day!

Robert gave you the difintion and where find to more informaton. I will add a little more to what is a API? If you know assembler, you code macros so it could be reusable in many programs and macros translates from one code with parms to a set of instructions to acomplish a programming task. API is something similar to a macro but for high level languages. When you code a API in your COBOL program that API has to be first trranslated before compilings your program. After translation the API code is commented out and a set of instructions are imbedded in your program to acomplish a programming task like reading a compress file and doing the expand at the same time, this API will be reusable in many programs to do same.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10210
Location: italy

PostPosted: Fri Apr 29, 2011 12:44 am    Post subject: Reply to: Information About API
Reply with quote

the additional info is misleading,
the translation stuff is just an irrelevant implementation detail

much better to stick to a good formal definition of the thing
quoting wikipedia ( which this time hit the nail right on the head )

as Robert said the first hit of a google search with API

Quote:
An application programming interface (API) is a particular set of rules and specifications that software programs can follow to communicate with each other. It serves as an interface between different software programs and facilitates their interaction, similar to the way the user interface facilitates interaction between humans and computers.
An API can be created for applications, libraries, operating systems, etc., as a way of defining their "vocabularies" and resources request conventions (e.g. function-calling conventions). It may include specifications for routines, data structures, object classes, and protocols used to communicate between the <consumer> program and the implementer program of the API.[1][2]
Back to top
View user's profile Send private message
Jose Mateo

Active User


Joined: 29 Oct 2010
Posts: 110
Location: Puerto Rico

PostPosted: Fri Apr 29, 2011 7:23 pm    Post subject:
Reply with quote

Enrico

That definition from Wikpedia is correct but confusing for someone that has use API code in an application program. From this definition a API could be a program which read an input file from a program and prepares an extract file for another program but this is not what Kishore is looking for. Instead I explained an API code which is standarize code for a company to perform a programming task which is reusable in many programs.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10210
Location: italy

PostPosted: Fri Apr 29, 2011 7:49 pm    Post subject: Reply to: Information About API
Reply with quote

Quote:
Robert gave you the difintion and where find to more informaton. I will add a little more to what is a API? If you know assembler, you code macros so it could be reusable in many programs and macros translates from one code with parms to a set of instructions to acomplish a programming task. API is something similar to a macro but for high level languages. When you code a API in your COBOL program that API has to be first trranslated before compilings your program. After translation the API code is commented out and a set of instructions are imbedded in your program to acomplish a programming task like reading a compress file and doing the expand at the same time, this API will be reusable in many programs to do same.


your additions are just plain wrong !

an assembler macro is not an API

an API is just that... a set of rules and a set of services
You are confusing the rules with the implementation details
and furthermore You are giving an incomplete picture

from your wording an API is something that is implemented thru a preprocessor, and that is just wrong
a preprocessor is just one of the ways of implementing an API

take for example the ISPF

the user and the reference guide define an API which are the set of rules
to be followed in order to use ISPF services,
no preprocessor is involved just calls to the functions defined by ISPF!
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7931
Location: Bellevue, IA

PostPosted: Fri Apr 29, 2011 7:56 pm    Post subject:
Reply with quote

Since this is posted under CICS, Kishore Chebrolu can look in the CICS manuals for the Front End Programming Interface manual. FEPI is an API, and reading the manual on it should help you understand what an API is and is not. A subprogram may invoke an API -- or may not, depending upon the coding. An API does not necessarily invoke a subprogram, either.

CICS commands are another API. The rules are that you invoke the API by coding EXEC CICS ... END-EXEC in your program. The CICS preprocessor finds those API invocations, converts them to language statements apprpriate to the language the program is coded in, and then the program can be compiled.
Back to top
View user's profile Send private message
Garry Carroll

Active Member


Joined: 08 May 2006
Posts: 991
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Fri Apr 29, 2011 7:57 pm    Post subject:
Reply with quote

Quote:
the additional info is misleading,
the translation stuff is just an irrelevant implementation detail

much better to stick to a good formal definition of the thing


I have to agree with Enrico and you are incorrect when you state
Quote:
API is something similar to a macro but for high level languages. When you code a API...


First, an API is not solely for use with high-level languages - they are fairly commonly used in Assembler programs. You don't code an API in a program, you code one or more API Commands from those available in an API in your program. The API commands typically implement a call to relevant (sub)system to utilise some function provided by that (sub)system.

API is not similar to a Macro as Macro does not provide an Interface to a (sub)system - it's simply a means of grouping instructions to provide for usability and readability when developing/maintaining code.

Garry.
Back to top
View user's profile Send private message
Jose Mateo

Active User


Joined: 29 Oct 2010
Posts: 110
Location: Puerto Rico

PostPosted: Fri Apr 29, 2011 9:56 pm    Post subject:
Reply with quote

Everybody has something to chip in and everybody is correct. I didn't state that a assembler macro is an API and I agree that in a program there's more than one API. My explanation was focus on Exec API XXXX, End-exec. IBM has an API guide and if you look into this book you will see that there's API for C, PL1, Etc. but for Assembler it's called a Macro API. I also agree with Robert that CICS Exec are API which needs to be translated before going thru the compiler. Thank you!
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 -> CICS All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Obtaining file information pahiker COBOL Programming 25 Tue Sep 27, 2016 7:25 pm
No new posts Need information on COBOL MOVE CORRES... subratarec COBOL Programming 10 Tue Jun 28, 2016 10:38 pm
No new posts Passing information through JCL as in... Pia Baruah JCL & VSAM 5 Wed May 25, 2016 2:22 pm
No new posts Extracting Information from DD Statem... Charles Wolters All Other Mainframe Topics 7 Wed Apr 13, 2016 10:21 pm
This topic is locked: you cannot edit posts or make replies. Job Offer: Information systems consu... Express Mainframe Jobs 0 Thu Mar 10, 2016 7:18 pm


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