iscobol.compiler.easylinkage=1 |
program-id. prog1. linkage section. 77 p1 pic 9. procedure division using p1. main. add 1 to p1. goback. |
public class test { public static void main (String[] args) throws Exception { //create an instance of linkPROG1 linkPROG1 prog1 = new linkPROG1(); //set the p1 parameter to 1 prog1.p1.set(1); //do the call prog1.run(); //check if p1 was incremented by 1 if (prog1.p1.toint() == 2) System.out.print("OK"); } } |
iscobol.compiler.easylinkage=2 |
program-id. showtempdir. working-storage section. 77 buflen pic s9(4) comp-5. 77 pathname pic x(128). procedure division. main. set buflen to size of pathname. call "GetTempPathA" using by value buflen by reference pathname. display pathname. goback. |
import com.iscobol.java.IsCobol; import com.iscobol.java.StopRunAsException; import com.iscobol.rts.IscobolRuntimeException; import com.iscobol.rts.Factory; import com.iscobol.rts.IscobolCall; import com.iscobol.types.*; public class GETTEMPPATHA implements IscobolCall { // Linkage variable declarations public byte returnCode$0[]; public com.iscobol.types.NumericVar returnCode; public com.iscobol.types.NumericVar returnUnsigned; public byte transactionStatus$0[]; public com.iscobol.types.PicX transactionStatus; public java.lang.Throwable exceptionObject; // variable declaration BUFLEN public byte buflen$0[]; public com.iscobol.types.NumericVar buflen; // variable declaration PATHNAME public byte pathname$0[]; public com.iscobol.types.PicX pathname; { returnCode$0=Factory.getMem(8); returnCode=Factory.getVarBinary(returnCode$0,0,8,false,null, null,null,"RETURN-CODE",false,18,0,true,false,false); } { returnUnsigned=Factory.getVarBinary(returnCode,0,8,false,null, null,null,"RETURN-UNSIGNED",false,18,0,false,false,false); } { transactionStatus$0=Factory.getMem(2); transactionStatus=Factory.getVarAlphanumPrv(transactionStatus$0,0,2,false,null, null,null,"TRANSACTION-STATUS",false,false); } { } { buflen$0=Factory.getMem(2); buflen=Factory.getVarNativeBinary(buflen$0,0,2,false,null, null,null,"BUFLEN",false,4,0,true,false,false,false); } { pathname$0=Factory.getMem(128); pathname=Factory.getVarAlphanum(pathname$0,0,128,false,null, null,null,"PATHNAME",false,false); } @Override public void perform(int arg0, int arg1) { } |
@Override public Object call(Object[] argv) { final int argl=(argv==null)?0:argv.length; switch (argl) { default: case 2: pathname.link((CobolVar)argv[1]); case 1: buflen.link((CobolVar)argv[0]); case 0: break; } /* Write here the routine logic * This is the call prototype: * * try { * returnCode.set(Factory.call("_new_GETTEMPPATHA", null, * new CobolVar[] {pathname.byRef(), * buflen.byVal()})); * } * catch (CallOverflowException ex) { * throw new WrapperException(ex); * } * / return returnCode; } @Override @SuppressWarnings("deprecation") public void finalize() { } } |
/* Write here the routine logic * This is the call prototype: * * try { * returnCode.set(Factory.call("_new_GETTEMPPATHA", null, * new CobolVar[] {pathname.byRef(), * buflen.byVal()})); * } * catch (CallOverflowException ex) { * throw new WrapperException(ex); * } * / |
pathname.set(System.getProperty("java.io.tmpdir")); |
iscobol.compiler.easylinkage=3 |