BookmarkSubscribeRSS Feed
Arin
Fluorite | Level 6

I'm trying connect to IMS to read a HDAM DB (DB1) segment (SEG1) and print first 5 records of it, but getting following error while executing PROC PRINT:

IMS has terminated. Return code = 9991

 

Here is my code:

//SASIMS   EXEC SAS                                                  
//SAS.WORK DD UNIT=(SYSDA),SPACE=(CYL,(100,99),RLSE),                
//            DCB=(RECFM=FS,LRECL=6144,BLKSIZE=6144,DSORG=PS)        
//MYLIB    DD DSN=TEST.DUMMY.DSN,                                    
//            DISP=(NEW,CATLG,DELETE),                               
//            SPACE=(CYL,(50,50),RLSE),UNIT=SYSDA,                   
//            LABEL=EXPDT=2019/365,                                  
//         DCB=(MODELDCB,RECFM=FS,LRECL=27648,BLKSIZE=27648,BUFNO=20)
//*                                                                  
//IMS      DD  DSN=TEST.PSBLIB,DISP=SHR                              
//         DD  DSN=TEST.DBDLIB,DISP=SHR                              
//DFSRESLB DD  DSN=TEST.RESLIB,DISP=SHR                              
//*                                                                  
//SYSIN    DD *                                                     

OPTIONS NODATE LINESIZE=120;                        


PROC ACCESS DBMS=IMS;                                
CREATE MYLIB.DB1.ACCESS;                             
DATABASE=DB1 DBTYPE=HDAM;                            
RECORD='TEST REC' SEGMENT=SEG1 SEGLNG=756;           
ITEM='FLD1' LEVEL=2 DBFORMAT=$16.  SEARCH=FLD1 KEY=Y;
ITEM='FLD2' LEVEL=2 DBFORMAT=$135. SEARCH=FLD2;      
AN=Y;                                                
LIST ALL;                                            
                                                     
CREATE MYLIB.SEG1.VIEW PSBNAME=PSB1 PCBINDEX=3;      
SELECT 'TEST REC';                                   
LIST VIEW;                                           
RUN;                                                


PROC DATASETS LIB=MYLIB;                             
CONTENTS DATA =_ALL_; QUIT;                          
RUN;                                                
PROC PRINT DATA=MYLIB.VSLPTAP(OBS=5);                
RUN;                                                

 

I'm unable to get to the root cause. Can someone please advise? 

 

Ref used to develop this code: http://support.sas.com/documentation/cdl/en/acims/59519/PDF/default/acims.pdf

4 REPLIES 4
JBailey
Barite | Level 11

Hi @Arin,

 

Because this involves IMS and JCL I think I deserve bravery points for replying to this post Smiley Happy

 

I did some snooping around and this issue shows up in our Tech Support system. The tracks I have reviewed all indicate that this is caused by an IMS issue. The suggestions were to apply a fix to the IMS system.  I suggest contacting SAS Tech Support so that they can help your z/OS systems programmer implement the solution. Reference this number - 7611433387 - when you contact SAS Tech Support.

 

Hopefully this will solve your issue and I will get to lord it over some of my SAS cohorts!

 

Best wishes,

Jeff

 

Arin
Fluorite | Level 6

Thanks much @JBailey! I finally have reached out to the SAS Tech Support.

 

However before that, following I tried without success:

1. DFSRRC00 IMS program was found missing, perhaps because DFSRESLB is not a supporting DD for SAS PROC.

So, tried to pass RESLIB as LOAD, and it failed as a different IMS system module DFSVCI00 wasn't accessible; it seemed to be in a NON-APF Library. 

 

2. Above mentioned error is usually received in IMS Jobs when RESLIB is not passed. So, DFSRESLB was added again, beside using the LOAD too. This time it failed with error: "UNABLE TO INITIALIZE DL/I BUFFERING SERVICES" Reason Code 04.

 

I understand that these are more IMS issues than that of SAS, but how these IMS PARMs and LIBs to be passed to SAS properly is still unknown to me.

JBailey
Barite | Level 11

Hi @Arin

 

I think this is going to boil down to the IMS issue.

 

Getting the JCL right is tough, too. I don't have any working JCL handy. If I logged into my MVS account it would spend days recalling libraries;) Let us know how this goes...

 

Working JCL would make a great SAS Communities article.

 

Best wishes,

Jeff

AnnaBrown
Community Manager

This topic sure would make a great community article, @JBailey.

 

@Arin, when you reach a solution with Tech Support, I encourage you to add it to this thread and consider writing an article on what you found out and how you got there. I explain why and how to write an article in this post: 3 reasons why you should write an article for the SAS Communities Library.

 

Best,

Anna


Join us for SAS Community Trivia
SAS Bowl XXIX, The SAS Hackathon
Wednesday, March 8, 2023, at 10 AM ET | #SASBowl

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 1033 views
  • 1 like
  • 3 in conversation