View previous topic :: View next topic
|
Author |
Message |
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Phrzby Phil
Senior Member
Joined: 31 Oct 2006 Posts: 1042 Location: Richmond, Virginia
|
|
|
|
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 |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 . . . 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. . .
Thanks,
d |
|
Back to top |
|
|
Phrzby Phil
Senior Member
Joined: 31 Oct 2006 Posts: 1042 Location: Richmond, Virginia
|
|
|
|
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 |
|
|
|