Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Running a cobol program from WebFocus

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Running a cobol program from WebFocus
 Login/Join
 
Member
posted
I just want to know if someone out there have experienced running cobol routines from web focus.
We have a webfocus reporting server on windows and we are using an eda adaptor to connect to our alpha machine. I can run a regular focus with no problem but I dont know how what to use/syntax for
calling a cobol routine. I tried most of the examples from the manual but nothing seems to work. Thanks.

This message has been edited. Last edited by: Kerry,
 
Posts: 7 | Registered: May 25, 2004Report This Post
Platinum Member
posted Hide Post
Be of good cheer.

I am running WebFocus 4.3.6 and 5.2.5 and MVS 7.1.1 and 7.2(a).

With this said. I need to know how your environment is set up.
At present I am running Webfocus that uses Cobol programs to Update/Insert into multiple DB2 databases and JCL to run other applications on the Mainframe.

So with a little bit more information I can point you in the correct direction.

Regards,
 
Posts: 117 | Location: US | Registered: February 09, 2004Report This Post
<Mike Miles>
posted
Can you provide code examples of how you execute a COBOL program and submit JCL via WebFOCUS? Thanks.
 
Report This Post
<Pietro De Santis>
posted
Modify the following example. This is assuming you have a JCL example on how to call a cobol program...

-SET &IRSTEMP = '&' | '&' | 'IRSTEMP' ;
-SET &COMMA = ',' ;
TSO ALLOC F(EXP01) DA(NEWJCL) NEW SPACE(10,10) TRACKS UNIT(PROD) BLKSIZE(80) -
DSORG(PS) LRECL(80) RECFM(F)
-RUN

-WRITE EXP01 //ZASIC04S JOB (ZASICG,O01A),' ', MSGCLASS=T
-WRITE EXP01 //STND OUTPUT PAGEDEF=V06481,DEST=RMT695,FORMDEF=010110
-WRITE EXP01 //HBCLIB JCLLIB ORDER=(YSMIC.FOCUS.PROCLIB)
-WRITE EXP01 //STEP1 EXEC FOCUS ,REGION=4096K
-WRITE EXP01 //MASTER DD DSN=ZIPIC.SRS.MASTER,DISP=SHR
-WRITE EXP01 //FOCEXEC DD DSN=ZIPIC.SRS.FOCEXEC,DISP=SHR
-WRITE EXP01 //IRSSDB1 DD DSN=ZHMIC.FCFSAM.SRS&SUBCLASS,DISP=SHR
-WRITE EXP01 //IRSTEMP DD DSN=ZIZIC.TEMP.INTERCEP,DISP=NEW
-WRITE EXP01 // DCB=(RECFM=FB,LRECL=240,BLKSIZE=23280)&COMMA
-WRITE EXP01 // UNIT=PROD,SPACE=(TRK,(10,1),RLSE)
-WRITE EXP01 //SYSIN DD *
-WRITE EXP01 TABLE FILE CAR
-WRITE EXP01 PRINT *
-WRITE EXP01 WHERE RECORDLIMIT EQ 10
-WRITE EXP01 END
-WRITE EXP01 FIN
-WRITE EXP01 //

TSO SUBMIT (NEWJCL)
TSO FREE F(EXP01)
TSO DELETE (NEWJCL)
-RUN
 
Report This Post
<MikeR>
posted
I tried the following code in WebFOCUS:

-* File TESTSUB.FEX
-SET &IRSTEMP = '&' | '&' | 'IRSTEMP' ;
-SET &COMMA = ',' ;
TSO ALLOC F(EXP01) DA(NEWJCL) NEW SPACE(10,10) TRACKS UNIT(SYSDA) BLKSIZE(80) -
DSORG(PS) LRECL(80) RECFM(F)
-RUN

-WRITE EXP01 //MDRTEST JOB 3432000,RASMUSSN,MSGCLASS=X,CLASS=B
-WRITE EXP01 //STEP1 EXEC PGM=IEFBR14
-WRITE EXP01 //FILE1 DD DSN=ISMDR.TEMP,DISP=SHR
-WRITE EXP01 //*

TSO SUBMIT (NEWJCL)
TSO FREE F(EXP01)
TSO DELETE (NEWJCL)
-RUN

but when I run it, it doesn't like the TSO statements. What am I missing?
 
Report This Post
<Pietro De Santis>
posted
This is all from so long ago. Are you in a TSO environment on the mainframe?

Try this, it's subtly different - it uses DYNAM ALLOC instead of TSO ALLOC. If I remember correctly, the -? TSO DDNAME command sets the environment variable &DSNAME so that the TSO SUBMIT can run correctly.

-SET &PROC = IF &&MM EQ '01' THEN 'SI920' ELSE 'SI921';

-SET &VIRGULE = ',';
-SET &NOMJOB = &&USERID || 'S';

-WRITE SI000T1 //&NOMJOB JOB (7272,E11),'H2Z1A4 16 JAMES DEAN',MSGCLASS=R
-WRITE SI000T1 /*RESSOURCE MEM=2000,CPU=2,LIG=10
-WRITE SI000T1 //*
-WRITE SI000T1 //PROC JCLLIB ORDER=(CT20.#7020.PROCLIB&VIRGULE
-WRITE SI000T1 // PI10.#1007.PROCLIB&VIRGULE
-WRITE SI000T1 // CT29.#8007.ES.PROCLIB)
-WRITE SI000T1 //*
-*RITE SI000T1 //&PROC EXEC &PROC
-WRITE SI000T1 //&PROC EXEC &PROC&VIRGULE
-WRITE SI000T1 // PREFLIB='PI10.#1007'&VIRGULE
-WRITE SI000T1 // PREFSI2='PI10.#1007'&VIRGULE
-WRITE SI000T1 // UNITDIS='DEVLOP'
-WRITE SI000T1 //SI920020.MASTER DD DSN=PI10.#1007.MASTER,DISP=SHR
-WRITE SI000T1 // DD DSN=CT20.#7020.MASTER,DISP=SHR
-WRITE SI000T1 //SI920030.STEPLIB DD DSN=CT20.#7020.CHGMT,DISP=SHR
-WRITE SI000T1 //SI920R1.STEPLIB DD DSN=CT20.#7020.CHGMT,DISP=SHR
-WRITE SI000T1 //SI920R1.DEST DD DSN=CT20.#7020.HQ.ADRESSE(H2Z1A432),DISP=SHR
-WRITE SI000T1 //SI920R1.RS0 DD SYSOUT=*,DCB=RECFM=A,OUTPUT=(*.OUT01)
-WRITE SI000T1 //YE050.STEPLIB DD DSN=CT20.#7020.LINKUSER,DISP=SHR

-? TSO DDNAME SI000T1

TSO SUBMIT '&DSNAME'
-RUN
 
Report This Post
<MikeR>
posted
That could be the problem here. I am trying to get this to run from WEBFOCUS as opposed to FOCUS. Is that even possible?
 
Report This Post
Platinum Member
posted Hide Post
You can do something similar to the two following conditions.

Control card

-WRITE JCL1 //&CARN JOB '2289,TEST,COM','BATCH REPORTS'&C
-WRITE JCL1 // CLASS=&JOBCLASS.,MSGCLASS=&MSGCLASS.,NOTIFY=&NOTIFY
-WRITE JCL1 //*------------------------------------------------
-WRITE JCL1 //SDEL EXEC PGM=IDCAMS
-WRITE JCL1 //SYSPRINT DD SYSOUT=*
-WRITE JCL1 //SYSIN DD *
-WRITE JCL1 DELETE &DSNAME
-WRITE JCL1 /*
-WRITE JCL1 //*

Execute part
-WRITE JCL1 //S50 EXEC TFOCUS
-WRITE JCL1 //FOCEXEC DD DSN=TEST.FOCUS.FOCEXEC,DISP=SHR
-WRITE JCL1 // DD DSN=PROD.FOCUS.FOCEXEC,DISP=SHR
-WRITE JCL1 //MASTER DD DSN=TEST.FOCUS.MASTER,DISP=SHR
-WRITE JCL1 // DD DSN=PROD.FOCUS.MASTER,DISP=SHR
-WRITE JCL1 //FOCSQL DD DSN=TEST.FOCUS.FOCSQL,DISP=SHR
-WRITE JCL1 // DD DSN=PROD.FOCUS.FOCSQL,DISP=SHR
-WRITE JCL1 //STEPLIB DD DSN=TEST.FOCUS.FOCLIB,DISP=SHR
-WRITE JCL1 // DD DSN=TEST.FOCUS.SQLLOAD,DISP=SHR
-WRITE JCL1 // DD DSN=DB2A.DSNLOAD,DISP=SHR
-WRITE JCL1 // DD DSN=PROD.IC.LOAD,DISP=SHR
-WRITE JCL1 // DD DSN=EDA.TEST.EDAUAT1.USERLIB,DISP=SHR
-WRITE JCL1 //USERLIB DD DSN=TEST.FOCUS.FUSELIB,DISP=SHR
-WRITE JCL1 // DD DSN=TEST.FOCUS.TNT.FUSELIB,DISP=SHR
-WRITE JCL1 // DD DSN=FOCUS.TNT.FUSELIB,DISP=SHR
-WRITE JCL1 // DD DSN=FOCUS.FUSELIB,DISP=SHR
-WRITE JCL1 // DD DSN=TEST.TRUST.LOAD,DISP=SHR
-WRITE JCL1 //FND470H DD DSN=FND.TEST.NAV.FND470HC,DISP=SHR
-WRITE JCL1 //SYSIN DD *
-WRITE JCL1 TSO SQL SET SSID XXXXX
-WRITE JCL1 TSO SQL SET PLAN DB2 plan name
-WRITE JCL1 TSO SQL SET ERRORTYPE DBMS
-WRITE JCL1 TSO SQL SET STATIC NOBIND
-WRITE JCL1 TSO SQL SET AUTODISCONNECT ON COMMIT
-WRITE JCL1 TSO SQL SET AUTOCLOSE ON COMMIT
-WRITE JCL1 TSO SQL SET OWNERID XXX
-WRITE JCL1 EX FOCEXEC(that executes the cobol program)
-WRITE JCL1 FIN
-WRITE JCL1 /*
-WRITE JCL1 //*
-CLOSE JCL1
-*
-TYPE SUBMIT TIME &FOCCPU
DYNAM SUBMIT JCL1
-RUN
DYNAM FREE FILE JCL1
-RUN

Running cobol from WEBFOCUS

SQL DB2 SET AUTOCOMMIT ON FIN
SQL DB2 SET PLAN DB2Named plan
-RUN
-********************************************************************
-*INVOKE COBOL PROGRAM
-********************************************************************

-SET &RETCODE=CALLDB2('DB2plan','cobol compile name','inparm1','inparm2','A12(out return code)');
-SET &RETPART1=SUBSTR(12,&RETCODE,1,8,8,'A8');
-SET &RETPART2=SUBSTR(12,&RETCODE,9,12,4,'A4');
-SET &RETNUM=BITVAL(&RETPART2,1,32,'I8');
-SET &LUW=IF &RETPART1 EQ 'COMPLETE' THEN 'SQL DB2 COMMIT WORK' ELSE
- 'SQL DB2 ROLLBACK WORK';
-RUN
&LUW
-IF &RETPART1 NE 'COMPLETE' GOTO BAD ELSE GOTO GOOD;
 
Posts: 117 | Location: US | Registered: February 09, 2004Report This Post
Gold member
posted Hide Post
To issue a TSO command such as submit, you need to prefix TSO with a dash.

-TSO SUBMIT(jclfile)

The same goes for any other OS command
-DOS...
-UNIX...

but as David pointed out - using the DYNAM command should work just fine, and would work from a batch environment as well.

This message has been edited. Last edited by: Gizmo,



Windows: WF 7.6.2: SQL Server 2008 R2
 
Posts: 86 | Location: Chicago | Registered: August 03, 2007Report This Post
Platinum Member
posted Hide Post
Hi All,

I know this is an old topic! I tried this code but i am getting an error.

Find the error in the below screenshot.


Could anyone help me.


WebFOCUS 7.6.4, Mainframe Focus
Windows XP, All Output Formats
 
Posts: 135 | Registered: November 30, 2010Report This Post
Virtuoso
posted Hide Post
I suppose you are running on windows

TSO is not a windows/dos command




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Report This Post
Platinum Member
posted Hide Post
Ya Frank, i am running on windows.

how to make the code run in windows?


WebFOCUS 7.6.4, Mainframe Focus
Windows XP, All Output Formats
 
Posts: 135 | Registered: November 30, 2010Report This Post
<JG>
posted
You cann't.

A windows WebFOCUS server cannot run a mainframe COBOL or any other type of mainframe procedure.

If you have remote server configured on the mainframe that the Windows WebFOCUS server can use
thne you may have possibilities using -REMOTE BEGIN/END

Otherwise no chance
 
Report This Post
Platinum Member
posted Hide Post
JG, i do have remote server configured, i will try REMOTE BEGIN/END and let you know my output.


WebFOCUS 7.6.4, Mainframe Focus
Windows XP, All Output Formats
 
Posts: 135 | Registered: November 30, 2010Report This Post
Platinum Member
posted Hide Post
If you use Micro-Focus COBOL (no relation to Information builders) to create a .exe. This can be called as a subroutine.

At least you could do this with FOCUS 6 for windows.

That was so long ago, I am not even going to look for an example. Because I am sure it is long gone.


Jim Morrow
Web Focus 7.6.10 under Windows 2003
MVS 7.3.3



 
Posts: 129 | Registered: June 01, 2005Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Running a cobol program from WebFocus

Copyright © 1996-2020 Information Builders