Positioning the file pointer and calling programs
This presentation is the property of its rightful owner.
Sponsored Links
1 / 8

Positioning the File Pointer and calling programs PowerPoint PPT Presentation


  • 84 Views
  • Uploaded on
  • Presentation posted in: General

Positioning the File Pointer and calling programs. Fall 2011. SETLL – Positioning the File Pointer. Sequential Access File Positions the file pointer at the first record where the key field is greater than on equal to what’s looked for Must be followed by a READ

Download Presentation

Positioning the File Pointer and calling programs

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Positioning the file pointer and calling programs

Positioning the File Pointer and calling programs

Fall 2011


Setll positioning the file pointer

SETLL – Positioning the File Pointer

  • Sequential Access File

  • Positions the file pointer at the first record where the key field is greater than on equal to what’s looked for

  • Must be followed by a READ

  • Use %FOUND to determine if the record found is greater than or equal to the key field

  • Use %EQUAL to determine if the record found is exactly the same as the key field that you are looking for


Setll example

SETLL Example

/Free

setll *loval custmast;

read custmast;

/end-free


Setll example1

SETLL – Example

/Free

setllcustincustmast;

if %equal(custmast);

exsrvalidcust;

else;

exsrinvalidcust;

endif;

/end-free

  • Custno Note Note_dtls

  • 1 Customer arrived

  • 1 2 Customer left

  • 1 Customer away

  • If Custin = 1, then the file pointer

  • for the first record will be returned


Setgt

SETGT

  • Sequential Access File

  • Positions the file pointer at the first record where the key field is greater than what’s looked for

  • Must be followed by a READ

  • Use %FOUND to determine if the record found is greater than the key field


Setgt example

Setgt Example

/Free

setll custin custmast;

if %equal(custmast);

exsr validcust;

else;

exsr invalidcust;

endif;

/end-free

  • Custno Note Note_dtls

  • 1 Customer arrived

  • 1 2 Customer left

  • 1 Customer away

  • If Custin = 1, then the file pointer

  • for the last record will be returned


Calling programs

Calling Programs

Code in pgmA

Dfullreport PR EXTPGM(‘REPORT’)

/free

callp fullreport();

Code in pgmB

pgmA

pgmB

No parameters

Passed


Calling programs1

Calling Programs

Code in pgmACode in pgmB

DDtlreport PR EXTPGM(‘REPORT’)Ddtlreport PR

D parm1 10A D parm1 10A

/freeDdtlreport PI

callp Dtlreport(field1);D parm1 10A

Code in pgmB

pgmA

pgmB

parameters

Passed


  • Login