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: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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