Questions tagged [fcmp]

FCMP is the SAS function compilation language, allowing users to write functions and subroutines that can be used in SAS data steps, DS2 packages, and certain proc steps.

PROC FCMP allows you to compile SAS user-written functions and subroutines for use in the SAS data step, and certain SAS procs (such as modelling procs). FCMP is a language that is still under substantial development, and has significant feature improvements with every iteration of the SAS language.

21 questions
3
votes
1 answer

No guaranteed libname when hashing data in PROC FCMP

I'm using SAS' PROC FCMP to write some functions for recoding. These will be saved in a data set in a shared directory, so my coworkers can use them. Most of the time, the functions are just wrappers that hash a look-up table in the same…
Nathan Werth
  • 5,093
  • 18
  • 25
3
votes
4 answers

Why does PROC FCMP function always return 33 bytes and no more?

I have the following function defined via PROC FCMP. The point of the code should be pretty obvious and relatively straightforward. I'm returning the value of an attribute from a line of XHTML. Here's the code: proc fcmp…
Jay Stevens
  • 5,863
  • 9
  • 44
  • 67
2
votes
2 answers

When app is in background or killed FCM onMessageReceived() not called

When app is in background or killed onRecive onMessageReceived() not called and i get just json in notification. below is my Service class public class AppFireBaseMessagingService extends FirebaseMessagingService { private static final String…
avez raj
  • 2,055
  • 2
  • 22
  • 37
2
votes
2 answers

how to go to specific activity on notification click?

There are several notifications and clicking on notifications i want to go to specific activity. Say a Reward notification appear and by clicking will go to RewardActivity and new friend added then clicking on newFriend notification will go to…
2
votes
1 answer

How to define a function with varying amount parameters?

I am new to proc fcmp and I want to know how to write a user-defined function with varying amount parameters, which like whichc() or coalesce(), in SAS. I will be grateful if anybody could give me some hints.
whymath
  • 1,262
  • 9
  • 16
2
votes
2 answers

FCMP with VARARGS not working as expected?

While researching FCMP to help answer another question on here, I was left a bit perplexed by how proc fcmp works when using the VARARGS option in order to be able to call that function with a variable number of arguments. The sas support page for…
user2877959
  • 1,792
  • 1
  • 9
  • 14
2
votes
1 answer

Proc FCMP - default parameter values

Is it possible to specify a default value for proc fcmp function parameters? Something like this: proc fcmp outlib=work.funcs.funcs; function my_func(param1, param2='default_value_here' $); * DO STUFF; endsub; run; From the documentation…
Robert Penridge
  • 8,424
  • 2
  • 34
  • 55
2
votes
1 answer

sql does not respect my fcmp function length

Can anybody explain to me how to get PROC SQL to give the results of my custom function the length I specify in the function definition? Datastep does it fine, but SQL gives me the default length of 200 characters. Here is code that demonstrates…
Roy Pardee
  • 196
  • 2
  • 12
1
vote
1 answer

Unable to use IN to search an array in a fcmp function

I have an fcmp function with an array, but the IN operator doesn't seem to work. What am I doing wrong? proc fcmp outlib=mylib.UserFuncLib.dateFuncs; function previousWorkingDayDate(dateWeekday); * Not a weekend and not a bank holiday; …
CaptainFuzzyFace
  • 339
  • 1
  • 3
  • 11
1
vote
1 answer

Using PROC FORMAT and PROC FCMP to convert values in SAS

I nedd to write a PROC FORMAT and PROC FCMPin my SAS programm to convert values in horsepower to watts. Watts should have the following format: XXXXX,XX Watt. proc fcmp outlib=work.functions.fun; function hptow(c) $; n = cats(c*745.7, '…
adeline
  • 21
  • 4
1
vote
1 answer

FCMP function giving unexpected results in PROC SQL

I wanted to take Rick Wicklin's macro (https://blogs.sas.com/content/iml/2015/10/05/random-integers-sas.html) that generates random numbers and convert it into an FCMP function. The FCMP function works as expected when called using…
Robert Penridge
  • 8,424
  • 2
  • 34
  • 55
1
vote
1 answer

Passing hash object as FCMP parameter

proc fcmp functions allow passing hash objects as parameters. The documentation is a little vague and it doesn't mention whether or not this ability is restricted to calls from other fcmp functions or if it's allowed from a data step call as…
Robert Penridge
  • 8,424
  • 2
  • 34
  • 55
1
vote
1 answer

SAS proc fcmp returns missing

I have the following code: options mprint mlogic symbolgen; %macro get_vtype(); %let table = %sysfunc(dequote(&table.)); %let var = %sysfunc(dequote(&var.)); data metadata.temp; set &table.; var = vtype(&var.); call…
zuluk
  • 1,557
  • 8
  • 29
  • 49
1
vote
1 answer

Is there an equivalent of the "of some_array{*}" form for use in SAS functions

Our database predates our database software having good unicode support, and in its place has a psuedo-base64 encoding which it uses to store UTF16 characters in an ascii field. I am writing a function to convert this type of field into straight…
littlefeltfangs
  • 396
  • 2
  • 17
1
vote
1 answer

SAS9.3 PROC FCMP can not save user defined function

I want to use proc fcmp to define my own function in SAS9.3. OS is aix 64bit. Here is my code (reg_func.sas): proc fcmp outlib=mylib.funcs.rule; function gen_sub_rule(); put "this is a test function"; return (0); endsub; run; quit; but after run…
1
2