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 🙂

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

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
  • 747 views
  • 0 likes
  • 2 in conversation