IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Have you called SAS from a COBOL program?


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Oct 31, 2012 12:13 am
Reply with quote

Has anyone (if it is even possible) called SAS from a COBOL program?

I've looked in the forums and on the web but have not found what i've been looking for.

Thanks,

d
Back to top
View user's profile Send private message
Phrzby Phil

Senior Member


Joined: 31 Oct 2006
Posts: 1042
Location: Richmond, Virginia

PostPosted: Wed Oct 31, 2012 12:30 am
Reply with quote

Since a SAS program is really the SYSIN to SAS, it would be SAS you'd calling.

A SAS program is interpreted, so I don't see how this would work.

Having said that, each SAS step is "compiled" in some sense, but not to object code, before being executed. I think one can pre-compile a SAS program, but would still need to execute SAS to run it. I have not done that.

What are you trying to do?
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Wed Oct 31, 2012 12:50 am
Reply with quote

Hi D,
I have once tried to call SAS from REXX just for knowing,
below is the code, Maybe this might give some idea of how to approach the problem with COBOL. One thing is, SAS requires SASLOG,SASUSER and SYSIN logical filenames to do its work.

Code:
/*REXX*/                                                                       
/*                                                                             
  "ALLOC F(SASLOG) DA('WELLS.SAS.LOG') NEW CATALOG DSORG(PS) RECFM(F B A),   
LRECL(133) BLKSIZE(0) CYL SPACE(1 1)"                                           
*/                                                                             
"FREE F(SASLOG SASUSER)"                                                       
"ALLOC F(SASLOG) DA('WELLS.SAS.LOG') SHR REUSE"                               
"ALLOC F(SASUSER)  DA('WELLS.SAS9.SASUSER') SHR"                             
"ALLOC F(SYSIN)  DA('WELLS.PROGRAM.PDS(SAS_PROGRAM_HERE)') SHR"                             
"CALL WELLS.SAS.V9R1M3.LIBRARY(SAS)"                                           
"FREE F(SASLOG SASUSER SYSIN)"                                                 
EXIT   


Hope it helps.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Oct 31, 2012 12:53 am
Reply with quote

Hi Phil,

One of my groups has a project where (a couple of weeks ago) they needed to generate a random number - using SAS. While SAS is on a system here, no one has experience/experise. As i'm one that inherits these "things". i asked here and got directon how to to this.

As ever, when something works, more must be better. Now they want to invoke this from some of their COBOL code and asked if i knew how as i'm the SAS guy . . . icon_confused.gif When they asked if i could look at this, gave my standard answer - "Sure i can look at it, might not be able to much about it - but i surely can look into it.".

Their client (Fedl Gov't) is high on SAS, so they are looking for "points" as well as the technical solution.

Guess i'd best download all of the SAS docs as i may need'em. . . icon_cool.gif

Thanks,

d
Back to top
View user's profile Send private message
Phrzby Phil

Senior Member


Joined: 31 Oct 2006
Posts: 1042
Location: Richmond, Virginia

PostPosted: Wed Oct 31, 2012 1:08 am
Reply with quote

Here's a possible dumb solution.

If they really need SAS random numbers, but can say the max they need (say, one billion), then just generate a file from SAS and read it into COBOL

A billion very small records is not too ridiculous.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> All Other Mainframe Topics

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts Using API Gateway from CICS program CICS 0
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
Search our Forums:

Back to Top