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
 

 

Passing parameter from JCL to a FOCUS program

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
karthickpearl

New User


Joined: 13 Apr 2010
Posts: 35
Location: Chennai

PostPosted: Tue Apr 13, 2010 8:57 am    Post subject: Passing parameter from JCL to a FOCUS program
Reply with quote

Hi,

Can anyone help me out with how to pass data from JCL SYSIN card to a FOCUS program.

Below is the FOCUS pgm,

Code:
TABLE FILE REPORT                 
PRINT AMT AS "PRICE"         
INV AS "INV-NO"             
INVDT AS "INV-DATE"           
BY AREA AS "AREA"         
IF INVDT FROM '100330'         
            TO '100330'           
ON TABLE SAVE AS OUTFILE FORMAT WP
END                               


The date field hard coded here must come from the JCL.
Back to top
View user's profile Send private message

nemo_budd

New User


Joined: 30 Mar 2008
Posts: 7
Location: Pune

PostPosted: Tue Apr 13, 2010 12:31 pm    Post subject: Reply to: Passing parameter from JCL to a FOCUS program
Reply with quote

You can pass the data from JCL to focus as below.

Code:
 
//SYSIN      DD *
EX FOCUS  INVBEGDT='100330', INVENDDT='100330'



Code:


TABLE FILE REPORT                 
PRINT AMT AS "PRICE"         
INV AS "INV-NO"             
INVDT AS "INV-DATE"           
BY AREA AS "AREA"         
IF INVDT FROM '&INVBEGDT'         
            TO '&INVENDDT'           
ON TABLE SAVE AS OUTFILE FORMAT WP
END   



If the dates are changed on regular basis like monthly or weekly, then you can calculate the date in your focus exec itself using date functions, without passing from JCL.
Back to top
View user's profile Send private message
karthickpearl

New User


Joined: 13 Apr 2010
Posts: 35
Location: Chennai

PostPosted: Tue Apr 13, 2010 1:04 pm    Post subject: Reply to: Passing parameter from JCL to a FOCUS program
Reply with quote

Your suggestion have worked.
Thanks a lot man...

I also tried the following and it wokred, but yours is a better way.

//STARTDT DD *
//050101
//ENDDT DD *
//100330

And in FOCUS

-READ STARTDT &START.I6.
-READ ENDDT &END.I6.
TABLE FILE REPORT
PRINT AMT AS "PRICE"
INV AS "INV-NO"
INVDT AS "INV-DATE"
BY AREA AS "AREA"
IF INVDT FROM '&START'
TO '&END'
ON TABLE SAVE AS OUTFILE FORMAT WP
END
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts DB2 Program abending without giving a... rahulgarg14 DB2 3 Mon May 29, 2017 8:10 pm
No new posts IMS T-Pipe queue counts in a COBOL Pr... Siva NKK Kothamasu IMS DB/DC 0 Tue May 09, 2017 6:31 pm
No new posts Need help in REXX CALL program Raje1002 CLIST & REXX 5 Wed Apr 19, 2017 11:18 pm
No new posts SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm
No new posts Can DFSPARM override SORTKEYS paramet... ashek15 DB2 2 Tue Jan 31, 2017 11:36 pm


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