BookmarkSubscribeRSS Feed
gskn4u
Obsidian | Level 7

Hello, 

 

I am trying to build user defined function in z/OS system. I gave a PDS name in the jcl but I am getting message 

 

ERROR: OUTLIB= requires a three level name: IFILE1.         
WARNING: The following functions will NOT be saved:         
   maxx                                                     

Can someone help me with an example in z/OS system. 

 

 

2 REPLIES 2
gskn4u
Obsidian | Level 7

I was able to execute below code. But I am not sure where WORK.ABC.XYZ resides nor where the function is saved. 

 

 

OPTIONS CMPLIB=WORK.ABC   ;                  
                                             
PROC FCMP  OUTLIB = WORK.ABC.XYZ       ;     
    FUNCTION MAXX(X,Y);                      
    IF X>=Y THEN RETURN(X);                  
    ELSE RETURN(Y);                          
    ENDSUB;                                  
RUN;                                         
                                             
DATA _NULL_;                                 
    A = MAXX(4,122343457);                   
    PUT A ;                                  
RUN;                                         
NOTE: Function MAXX saved to WORK.ABC.XYZ.                     
NOTE: The PROCEDURE FCMP used 0.06 CPU seconds and 31119K.     
PeterClemmensen
Tourmaline | Level 20

Unlike most procedues, we specify a three level name in the Outlib Option to FCMP. The three levels consist of a libname, a data set name and a package name. A package is the structure that the function is saved and retrieved to/from. A data set can contain multiple packages and a package can contain multiple functions.

 

Hope this makes sense 🙂

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 438 views
  • 0 likes
  • 2 in conversation