QShell problem on ASP

Hi Experts,

In a CL I collect information about *.CSV files in a specific IFS map.  /mypath/*.[Cc][Ss][Vv]
The output is redirected to an existing file /QSYS.LIB/PRODLIB.LIB/MYFILE.FILE/MYFILE.MBR

QSH CMD('find /mypath/*.[Cc][Ss][Vv] > /QSYS.LIB/MYLIB.LIB/MYFILE.FILE/MYFILE.MBR')  
On our developementserver it worked fine.

Now we transfered the software to the testenvironment on the production server
find /mypath/*.[Cc][Ss][Vv] > /QSYS.LIB/TESTLIB.LIB/MYFILE.FILE/MYFILE.MBR  
And it still works as expected.

Once we tried it on the Production environment, it stop working, (the  /PRODLIB is located on ASP1).
so I added  /IASP1 to the path,
find /mypath/*.[Cc][Ss][Vv] > /IASP1/QSYS.LIB/PRODLIB.LIB/MYFILE.FILE/MYFILE.MBR  
and still get the error:
qsh: 001-0055 Error found creating file /IASP1/QSYS.LIB/PRODLIB.LIB/MYFILE.FILE/MYFILE.MBR. No such path or directory.
LVL 17
MurpheyApplication ConsultantAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Gary PattersonVP Technology / Senior Consultant Commented:
Do PRODLIB.LIB and MYFILE.FILE exist on iasp1?  Does the profile your are running under have adequate rights to create a new member in MYFILE.FILE?
0
MurpheyApplication ConsultantAuthor Commented:
Hi Gary,

MYFILE.FILE and MYFILE.MBR are existing in PRODLIB.LIB, that is on the ASP.
I'm not sure if I can see that, so I did a test on the file by RTVOBJD and asked for the ASP info.
I already asked to check the authorization, but will check it myself again.

MYFILE.FILE, has only 1 member that will be replaces on every find.
0
Gary PattersonVP Technology / Senior Consultant Commented:
Might also want to manually create the file.member, too.  I dont usually redirect to qsys.lib file system from qshell.or PASE.  Might be that it doesn't want to create a member, but can replace it, or clear it and write new contents.
0
10 Tips to Protect Your Business from Ransomware

Did you know that ransomware is the most widespread, destructive malware in the world today? It accounts for 39% of all security breaches, with ransomware gangsters projected to make $11.5B in profits from online extortion by 2019.

MurpheyApplication ConsultantAuthor Commented:
Library file and member are available, (In test it is working)
The only difference is that test isn't on asp If i do a RTVOBJ on the testfile, the asp info returns *SYSBAS
0
Gary PattersonVP Technology / Senior Consultant Commented:
Have you tried SETUSRASP, then referencing.path without iasp prefux?
0
MurpheyApplication ConsultantAuthor Commented:
Hi Gary,

I don't know the command SETUSRASP neither do iSeries :-(

In the meantime, I checked the 2 files in both libraries and the security and owner are identical,
so I would check the files on the IFS site with  "System i Navigator" and found the following...

in: [File Systems > Integrated File System> QSYS.LIB]
The production library is available, the testlibrary isn't ???

In:  [Databases > Tables]
The target-file is NOT available/visible in both environments

I'm 100% sure double checked with WRKOBJ *ALL/filename that the files are in those libraries.
The file is created without DDS, can that be the reason?

I did check the Testlibray with
WRKAUT OBJ('/QSYS.LIB/TESTLIB.LIB') and see the  authorization screen
when I do the same with
/QSYS.LIB/PRODLIB.LIB  or  /IASP/QSYS.LIB/PRODLIB.LIB I get "Object not found"


in QSH   cd /QSYS.LIB/PRODLIB.LIB  is already give an error "Error found changing to directory /QSYS.LIB/PRODLIB.LIB"
0
Gary PattersonVP Technology / Senior Consultant Commented:
Sorry meant SETASPGRP.
0
MurpheyApplication ConsultantAuthor Commented:
Gary,

SETASPGRP doesn't work,
First I tried it as an interactive command,
 Message-ID . . . . . . :   CPDB8EC                                              
                                                                                
 Message . . . . :   ASP group IASP1 not set for thread X'000000000000005E'.    
                                                                                
 Cause . . . . . :   An attempt to set the auxiliary storage pool (ASP) group   
   for the current thread failed. The reason code is 1.                         
     The reason codes are:                                                      
     1 - Set is not allowed by an active operating system function. For a list  
   of these functions, see the help for the SETASPGRP command.                  

Open in new window

So I created a CL to submit a test, including the SETASPGRP command.

When I looked to the logging I saw that the submitted job already contains a  SETASPGRP.
but the qsh command still not working. The log shows
ASP group set to IASP1.                                              
Job 040397/xxx/QDFTJOBD gestart op 24/08/18  10:45:37 in subsysteem QBATCH in QSYS. 
>> CALL PGM(MYLIB/##TEST)                             
   300 - QSH CMD('ECHO TEST > /QSYS.LIB/PRODLIB.LIB/MYFILE.FILE/MYFILE.MBR')   
   Command ended normally with exit status 2.

Open in new window


 as control i did the same in the testlibrary
ASP group set to IASP1.                                                    
Job 040380/xxx/QDFTJOBD starton 24/08/18  10:41:51 in subsysteem QBATCH in QSYS. 
>> CALL PGM(MYLIB/##TEST)                           
   300 - QSH CMD('ECHO TEST > /QSYS.LIB/TESTLIB.LIB/MYFILE.FILE/MYFILE.MBR') 
   Command ended normally with exit status 0.

Open in new window

Result was a record in the testfile

Is it possible that there is a separate ASP setting required for QSH, or an Environment Variable?
0
Shalom CarmelCTOCommented:
Afaik, when you issue the SETASPGRP command, all of the libraries referenced in the thread must be in the ASP.
However, QSH uses a path that includes the QSYS library - /QSYS.LIB/PRODLIB.LIB/MYFILE.FILE/MYFILE.MBR

But I am probably wrong, it's been a while :)
0
Shalom CarmelCTOCommented:
Also look at this thread, the problem is eerily similar

https://archive.midrange.com/midrange-l/201709/msg00144.html
0
MurpheyApplication ConsultantAuthor Commented:
Hi,

If I start qsh and go to the root '/', I see QSYS.LIB and IASP1 as entry ;
drwxrwsrwx     9 QSYS        0                  8192 Sep 16  2013 IASP1  
drwx---r-x  1377 QSYS        0              21241856 Aug 24 11:35 QSYS.LIB

in QSYS.LIB I can find TESTLIB.LIB, but not PRODLIB.LIB so I expected that I would find that in /IASP1, but it isn't there.
It could be a authorization issue, but I'm not sure if they should visible in the /IASP1 map..
0
MurpheyApplication ConsultantAuthor Commented:
Hi All,

I assume it can not be done, reason for assumtion:
  • When I use RTVDIRINF, it refuse to make a QTEMP file ; (the actual QTEMP isn't accesible from QSH)
  • When I use RTVDIRINF to a preferred libary/file, it always use a tempfile in QGPL and copy that on OS2-level to my preferred file, to prevent problems if the preferred file is in an ASP1 library?
  • No right answer is given (yet)
0
MurpheyApplication ConsultantAuthor Commented:
I use the slower RTVDIRINF instead
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Software

From novice to tech pro — start learning today.