Not able to access an alias (DDM) file
Last Post 15 Mar 2013 05:15 PM by Eric Wasek. 7 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
Eric Wasek
Basic Member
Basic Member
Posts:88

--
03 Dec 2012 11:06 AM

I am trying to develop processing for an alias file on a 6.1 system.  A service program uses SQL to create the alias on a database file. 

 

CREATE ALIAS TMPMSGCHK FOR QTEMP/MSGCHECK

 

The SQL statement actually creates a DDMF type file on the system that looks like the following. 

 

DSPFD Command Input                                                                                 
  File  . . . . . . . . . . . . . . . . . . . : FILE       TMPMSGCHK                                
    Library . . . . . . . . . . . . . . . . . :            QTEMP                                    
  Type of information . . . . . . . . . . . . : TYPE       *ALL                                     
  File attributes . . . . . . . . . . . . . . : FILEATR    *ALL                                     
  System  . . . . . . . . . . . . . . . . . . : SYSTEM     *LCL                                     
File Description Header                                                                             
  File  . . . . . . . . . . . . . . . . . . . : FILE       TMPMSGCHK                                
  Library . . . . . . . . . . . . . . . . . . :            QTEMP                                    
  Type of file  . . . . . . . . . . . . . . . :            Device                                   
  Device type . . . . . . . . . . . . . . . . :            DDM                                      
  Auxiliary storage pool ID . . . . . . . . . :            00001                                    
DDM File Attributes                                                                                 
  File level identifier . . . . . . . . . . . :            1121203104736                            
  Creation date . . . . . . . . . . . . . . . :            12/03/12                                 
  Remote file . . . . . . . . . . . . . . . . : RMTFILE    'QTEMP/MSGCHECK                          
                                                                                                   '
  Remote location                               RMTLOCNAME                                          
  Name or address . . . . . . . . . . . . . :            '*LOCAL'        
  Type  . . . . . . . . . . . . . . . . . . :            *SNA            
Text 'description'  . . . . . . . . . . . . : TEXT                       
Device  . . . . . . . . . . . . . . . . . . : DEV        *LOC            
Local location name . . . . . . . . . . . . : LCLLOCNAME *LOC            
Mode  . . . . . . . . . . . . . . . . . . . : MODE       *NETATR         
Remote network identifier . . . . . . . . . : RMTNETID   *LOC            
Access method . . . . . . . . . . . . . . . : ACCMTH     *RMTFILE        
Share open data path  . . . . . . . . . . . : SHARE      *NO             
Protected conversation  . . . . . . . . . . : PTCCNV     *NO             
Record format level check . . . . . . . . . : LVLCHK     *RMTFILE        

 

The alias file cannot be opened in a service program or displayed using the WRKF command and option 5.  Both access methods result in the following error. 

 

Message ID . . . . . . :   CPF4364       Severity . . . . . . . :   40        
Message type . . . . . :   Escape                                             
Date sent  . . . . . . :   12/03/12      Time sent  . . . . . . :   11:27:34  
Message . . . . :   Remote location *LOCAL for program device DDMDEVICE was   
  not found.                                                                  
Cause . . . . . :   One of the following occurred:                            
    -- The remote location was not defined.                                   
    -- Not enough time was allowed to find the remote location.               
    -- The combination of remote location *LOCAL, device *LOC, location *LOC, 
  and remote network ID *LOC is not correct.                                  
Recovery  . . . :   Do one of the following and try the request again:        
    --If the remote location was not defined, create the device description   
  for the remote location or add the remote location to advanced peer-to-peer 
  networking (APPN).                                                          
    -- If not enough time was allowed to find the remote location, increase   
  the time specified in the WAITFILE parameter on the Change Intersystem     
  Communications Function File (CHGICFF) command or the Override Intersystem 
  Communications Functions File (OVRICFF) command to allow the system to wait
  longer to find the remote location.                                        
    -- If the combination of remote location *LOCAL, device *LOC, location   
  *LOC, and remote network ID *LOC is not correct, use the Work with         
  Configuration Status (WRKCFGSTS) command to select the correct combination.

 

The DDM server has been checked and is running. 

 

What else needs to be done to access the data in the alias file? 

 

Your help is appreciated.  

Emmanuel
Veteran Member
Veteran Member
Posts:806
Avatar

--
03 Dec 2012 12:20 PM

You can't access a file in the QTEMP library of another job, let alone one on another system. So this is the problem:

Remote file . . . . . . . . . . . . . . . . : RMTFILE    'QTEMP/MSGCHECK      

Cheers,

Emmanuel

Eric Wasek
Basic Member
Basic Member
Posts:88

--
03 Dec 2012 12:31 PM
Emmanuel,
I am sorry for leaving out a couple of important details. All of this is happening in the same job on the 6.1 system. This process does not access data on any other system.
Eric
Eric Wasek
Basic Member
Basic Member
Posts:88

--
03 Dec 2012 12:53 PM
I went into SQL on that job and ran a SELECT for the alias file (TMPMSGCHK) in QTEMP and it showed the data in the file. So SQL can access the data but neither the WRKF command nor an open in RPG will work. This seems a little unusual.
Craig R. Lockhart
Veteran Member
Veteran Member
Posts:1167
Avatar

--
04 Dec 2012 09:25 AM

Eric, 

WrkF can see aliases.  I just rechecked to ensure that I remembered correctly.  As far as referencing it in an RPG, it has been 2 decades since I have done that, but I always had the RPG use the non-DDM file and had an override in place pointing to the DDM file.  I am not sure if an alias DDM file has a different "flavor" than a normal DDM file.  ... and if you are using an alias, why not use embedded SQL to reference the alias?  (Just curious.)

All that said, you will want to create your alias in a library other than QTemp.  SQL is not great friends with QTemp and you are just tempting an ill-fate trying to get them to play nice with each other :P

 

Emmanuel,

Alias creates a local DDM file under the covers.  Said another way: The DDM file points to s file on the current machine.

Lynne Noll
Senior Member
Senior Member
Posts:6567

--
04 Dec 2012 11:17 AM
You can't use normal SQL to access the data in a 'real' ddm file, and you can with an 'alias' DDM. I think IBM just used some data base objects they had hanging around to handle the alias logic. You can see the alias with WRKF, but you can't display the data (I tried a standard DDMF and couldn't access it with WRKF or DBU either, but this may be an authorization issue-DDM uses QUSER to access.)

WRKF is displaying a physical file; it can't display the data in an old time logical file.

The alias is mainly to let SQL access members easily--you can point to any of the members in a file. RPG F Specs can access members pretty simply with overrides.


Eric Wasek
Basic Member
Basic Member
Posts:88

--
04 Dec 2012 03:26 PM
Craig,
The alias DDM file is a different "flavor" than a normal DDM file. Good point about using embedded SQL - this is what I will be working on next. I think that SQL and QTEMP will be friendly enough to do what is expected of them for this project.

Lynne,
I am using the alias for a different reason - to keep the file creation and processing within the program so that overrides are not needed.

Thank you both for your input. I will post concluding remarks after the results are checked.
Eric Wasek
Basic Member
Basic Member
Posts:88

--
15 Mar 2013 05:15 PM
After delays from other projects and PTFs, I can finally post concluding remarks. Embedded SQL did the trick. The SQL statement was set to
Select * from TMPMSGCHK
Then 'Exec sql' was used to 'prepare', 'declare', 'open' with 'fetch next' in a 'dow' loop, and then 'close'.

It works great. Thanks again.
You are not authorized to post a reply.

Acceptable Use Policy