Greetings,

    I have a problem I can't figure out.  I have a REXX module (actually a web CGI) that during it's processing, reads/writes a user profile to SFS several times during execution.  I've recently started getting an error from the pipe with rc=740 (DMSQRQ1157E Work unit already active when atomic request is issued for work unit 1 ).  I did a bit of searching, but was unable to find a description of rc740, so I assume the DMS1157E must be the description.  When this started I was using (read example)  '  <sfs myfile data VM3:USER.PROFILES '.  I also only get this a small percentage of the time.  Most executions are clean.

    I discussed this with a colleague who suggested that there was another pipe stage that might provide relief.  After some research it looked like filetoken might be the answer.  I set up the code like the example in the PIPELINES manual, but no happiness ensued, I got the same error.  Risking TMI, I'm including some snippets of the code I'm using if it's helpful.

Thanks,
DeWayne

/* some code above */
   file = ntid 'PROFILE VM3:USER.PROFILES'
   intent = 'READ NOCACHE'
   Parse Value ALLOCWU(file ';' intent) With mywu ';' wutoken
   Address Command 'PIPE (Endchar   Name LPSSO.CGI:361) ' ,
     '  filetoken' wutoken ,
     '| a: nlocate /LASTACC/' ,
     '| fa: faninany' ,
     '| stem profout. append ' ,
     ' a:' ,
     '| specs w1 1 /' || newdate || '/ nw /' || newtime || '/ nw' ,
     '| fa:'
   If rc ^= 0 Then erc = SEND_NOTIFICATION(rc,'5a read profile')
   Call CSL 'DMSCOMM return_code reason_code 0 wu_error 148'
   Call RETURNWU mywu
   file = ntid 'PROFILE VM3:USER.PROFILES'
   intent = 'WRITE NOCACHE'
   Address Command 'PIPE (Endchar   Name LPSSO.CGI:371) ' ,
     '| stem profout. ' ,
     '| filetoken' wutoken
   If rc ^= 0 Then erc = SEND_NOTIFICATION(rc,'5b write profile')
   Call CSL 'DMSCOMM return_code reason_code 0 wu_error 148'
   Call RETURNWU mywu
/* some code following */

Exit

/*============================================================================*/
/* */
/*      Allocate a private workunit for SFS reads and writes                  */
/* */
/*============================================================================*/
ALLOCWU:
   Parse Arg file ';' intent
/* Get private work unit */
   Call CSL 'dmsgetwu sfsrc sfsreason workunit'
/* Open the file */
   Call CSL 'dmsopen sfsrc sfsreason file' Length(file) ,
     'intent' Length(intent) 'filetoken workunit'
   xtoken = C2x(filetoken)
   Return workunit ';' xtoken

/*============================================================================*/
/* */
/*      Return workunit and close file implicitly                             */
/* */
/*============================================================================*/
RETURNWU:
   Parse Arg workunit
/* Return unit of work, which closes the file implicitly */
   Call CSL 'dmsretwu sfsrc sfsreason workunit'
   Return

Reply via email to