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

Converting SAS code to Cobol or Easytrieve


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Ashish.Raghav

New User


Joined: 25 Dec 2012
Posts: 1
Location: India

PostPosted: Fri Jun 29, 2018 6:01 pm
Reply with quote

My shop is planning to get rid of SAS from mainframes. Does anyone have experience in doing this using a third party product or an in house one? If possible, we would like to convert it to Cobol or Easytrieve. Please note that the SAS codes are running in batch through a JCL.
Back to top
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 917
Location: The Universe

PostPosted: Fri Jun 29, 2018 6:50 pm
Reply with quote

My guess is that it is not possible, for practical purposes, for several reasons.
  • Much SAS processing is done by the statistics functions. Rewriting these functions in Cobol can be done, of course, but it would be a major effort by programmers that are very fluent in both statistics and Cobol. The real cost, I think, would be equivalent to several years of SAS license fees.
  • You did not mention the cost of transforming SAS data base data to "flat" data sets.

Did whoever proposed removing SAS think about these issues?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8700
Location: Dubuque, Iowa, USA

PostPosted: Fri Jun 29, 2018 9:13 pm
Reply with quote

If the SAS code is merely doing reporting using DATA steps, the conversion can be done. It will be costly, though -- at a previous employer I had a SAS program that was converted to COBOL. The COBOL version took a couple of months to develop (as opposed to a week or so of SAS coding) but did replicate the SAS report precisely.

If the SAS code has many PROC statements, conversion would be MUCH more expensive since the PROC functions would have to be duplicated and that could, potentially, require someone with a statistical background to provide assistance.

One option to consider would be World Programming System which sells a product that is supposed to duplicate SAS coding. Another option would be to install SAS on a PC or server and move the SAS processing from the mainframe to that machine. SAS licensing for a PC is much cheaper than mainframe pricing, if cost reduction is the impetus for the switch from SAS.
Back to top
View user's profile Send private message
vasanthz

Global Moderator


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

PostPosted: Fri Jun 29, 2018 11:38 pm
Reply with quote

Quote:
One option to consider would be World Programming System which sells a product that is supposed to duplicate SAS coding. Another option would be to install SAS on a PC or server and move the SAS processing from the mainframe to that machine. SAS licensing for a PC is much cheaper than mainframe pricing, if cost reduction is the impetus for the switch from SAS.

Adding to this it is possible to reduce the licensing cost with sub capacity licensing for SAS
support.sas.com/techsup/technote/ts773.pdf

Having worked only on SAS since I started, I think it will be very difficult to mimic what SAS does through COBOL.

For instance,
SAS can read records from a dataset or USS file and process and write records to a file/dataset all in 7 lines of code. And it provides great debugging options

Code:
data
infile
input
process
file
put
run
Back to top
View user's profile Send private message
Phrzby Phil

Senior Member


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

PostPosted: Sat Jun 30, 2018 3:00 am
Reply with quote

Totally non-trivial.

Example: variables in SAS are not typed. I can say
Code:
VAR = 123.5;
and later
Code:
VAR = 'ABC';
(Same variable)

Here's a good one:
Code:
A = B = C;
Evaluating from the right, if B=C, then A is set to 1, else A is set to 0.

There's plenty more. SAS is interpreted, not compiled.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Mon Jul 02, 2018 11:56 am
Reply with quote

As Robert says - look at WPS. I have actually done a conversion from SAS to WPS for all of the SAS and SAS/AF applications

Otherwise it will be a long hard analysis and recode job
Back to top
View user's profile Send private message
Phrzby Phil

Senior Member


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

PostPosted: Tue Jul 03, 2018 9:35 am
Reply with quote

One very important issue with production SAS is the issuance of warnings and errors in the SASLog that are issued during the run as opposed to a COBOL compiler's messages.

To deal with this, I developed years ago a SASLog filter program with a list of all text to search the SASlog for. All SASLogs in the run were written to a dataset (or file (lol)) and then run thru the filter to produce a report of where such messages occurred with their context.

Filter program's table might be:
Code:
SEARCH_TOKENS = lowcase(
                         'invalid/'
                      || 'missing/'
                      || 'uninitialized/'
                      || 'was not found/'
                      || 'WARNING:/'
                      || 'ERROR/'
                      );



and the report:

Code:
08/04/2008         SASLog Filter
 9:56:16           C:\A - Test\SASLog - TEST - 2008-07-23 112233.log


Search Tokens
=============
error
invalid
missing
uninitialized
warning:
was not found


          Token           Line# Line -->
========================= ===== ========
missing                       2 1450  put 'TEST - MISSING uninitialized';
                                                  ~~~~~~~                                                                                                             

uninitialized                 2 1450  put 'TEST - MISSING uninitialized';
                                                          ~~~~~~~~~~~~~                                                                                               

missing                       6 TEST - MISSING uninitialized
                                       ~~~~~~~                                                                                                                       

uninitialized                 6 TEST - MISSING uninitialized
                                               ~~~~~~~~~~~~~                                                                                                         

error                         7 ERROR: Execution terminated by an ABORT statement at line 1451 column 1.
                                ~~~~~                                                                                                                               

error                         8 _ERROR_=1 _N_=1
                                 ~~~~~                                                                                                                               

warning:                     10 WARNING: The data set WORK.DATA35 may be incomplete.  When this step was stopped there were 0
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 purge jobs with return code 0 and ret... JCL & VSAM 4
No new posts COBOL sorting, with input GDG base COBOL Programming 7
No new posts Need help with ADABAS query (COBOL-AD... All Other Mainframe Topics 0
No new posts Overwriting SSN Digits in Easytrieve ... CA Products 0
No new posts Replacing FILLER with FILLER<SeqNu... DFSORT/ICETOOL 2
Search our Forums:

Back to Top