IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

SPOOL commands for INTRDR


IBM Mainframe Forums -> CICS
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
varQon

New User


Joined: 27 Jul 2019
Posts: 3
Location: India

PostPosted: Sat Jul 27, 2019 1:05 am
Reply with quote

Hi, I tried this program to enter jcl directly to the internal reader via SPOOLOPEN OUTPUT, SPOOLWRITE, SPOOLCLOSE commands but It throws strange errors:

code taken from here --> www.ibm.com/support/knowledgecenter/en/SSGMCP_5.5.0/applications/designing/dfhp3tz.html


Code:

#define PARMS struct _parms

PARMS
{
int parms_length;
char parms_info[200];
PARMS * pArea;
};
int main()
{
    PARMS ** parms_ptr;
    PARMS parms_area;
    char token[8];
    long rcode1, rcode2;

    /* These lines will initialize the outdescr area and
    set up the addressing */

    parms_area.parms_info[0]= '\0';
    parms_area.pArea = &parms_area;
    parms_ptr = &parms_area.pArea;

   /* And here is the command with ansi carriage controls
   specified and no class*/

    EXEC CICS SPOOLOPEN OUTPUT
    NODE ( "LOCAL" )
    USERID ( "INTRDR" )
    OUTDESCR ( parms_ptr )
    TOKEN ( token )
    ASA
    RESP ( rcode1 )
    RESP2 ( rcode2 );


But I constantly get error, token as S0000003 or S0000001 & constantly I get rcode1 as 16617696.

Now I read it here [https://www.microfocus.com/documentation/enterprise-developer/ed22/ETS/GUID-EA5020D9-6741-44AE-868B-AEE8325B9C0E.html] that I need to activate SSTM to access SPOOL functionality but on trying to run that provided JCL:

Code:

//SSTMJCL JOB 'CICS JOB',MSGCLASS=A
//CICS     EXEC PGM=NOTUSED
//SYSOUT   DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SHAREDD1  DD DSN=SHARED.ACROSS.SEPS1,DISP=(MOD,CATLG)
//LOCALDD1  DD DSN=&&SEPLOCAL,DISP=NEW
//JOBSUB    DD SYSOUT=(*,INTRDR)


as it is I get JCL error which is beyond me as I am new to mainframes. What should I do? I tried submitting that above JCL by using some existing JCL's PGM name and submitted it by SUB command.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Sat Jul 27, 2019 1:42 am
Reply with quote

So why do you even care what the value of TOKEN is? The manual you referenced states
Quote:
SPOOLOPEN returns a unique token in the TOKEN field, which must be used in all subsequent SPOOLWRITE and SPOOLCLOSE commands to identify the file being written.
so as long as you keep using that value, don't even think about what the value is. My guess is that it represents the dynamically allocated DD name, but that is just my guess.

Why are you referencing Microfocus manuals in a post about the mainframe? This is also in the IBM manual you cited:
Quote:
To use the CICS interface to JES, you must define the DFHSIT SPOOL=YES system initialization parameter in your CICS startup JCL.
and it is a whole lot more relevant than some Microfocus comment. If your site support group hasn't set SPOOL=YES in the SIT for your CICS region, you will not be able to use SPOOL commands. So you need to verify with your site support group first. I have no idea what the Microfocus SSTM parameter is or does since it is NOT part of z/OS CICS and I've never heard of it before today (but then, I've only been doing CICS system programming for 30 years or so).

If you are wanting to submit JCL via CICS SPOOL commands, you do NOT want ASA -- that indicates that the first character of each record is a carriage control character and that carriage control character will render the JCL unreadable by the system. Use NOCC instead.

In hex, your 16617696 is FD 90E0. You didn't provide us the value of rcode2 (RESP2), which can be beneficial in debugging problems. If the 90 is the value of the RESP for the SPOOLOPEN command, that would indicate a NODEIDERR for which the CICS manual says
Quote:
occurs in any of the following situations:
JES cannot identify the NODE/USERID combination specified on SPOOLOPEN OUTPUT.
RESP2 gives the dynamic allocation response code that denotes this error. The first two characters are the information reason code (S99INFO), and the second two are the error reason code (S99ERROR), as defined in the z/OS MVS Programming: Assembler Services Guide.
Back to top
View user's profile Send private message
varQon

New User


Joined: 27 Jul 2019
Posts: 3
Location: India

PostPosted: Sat Jul 27, 2019 1:53 am
Reply with quote

RESP2 was printed as 0 for above. Apart from this when I tried -->

Code:

CICS SET TDQUEUE(some_4_char_value_from_my_system's_job) OPENSTATUS
(19) RESP(retcode1) RESP2(retcode2)


I got a failure with retcode1 as 16 and retcode2 as 9.

Before this I wrote the entire JCL with SYSOUT=(A,INTRDR) into a TD QUEUE and it didn't throw any error.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Sat Jul 27, 2019 5:27 pm
Reply with quote

The CICS System Programming manual indicates that a RESP of 16 has this meaning:
Quote:
16
OPENSTATUS was specified, but the JCL DDNAME to which the queue definition points was not found.
So it appears that whatever DD name the TDQ points to has not been added to the JCL. Contact your site support group as changing CICS start up JCL is usually a function of the system programmers.

Furthermore, you need to decide about using SPOOL commands or writing to a TDQ since the CICS API commands are very different between the two approaches.

Finally, you probably should be posting on Beginners and Students Forum instead of this one as it is geared more to your skill level. This forum is for experts who can look up RESP codes in the manual and not have to ask what they mean. The same people who respond on this forum generally also respond on that forum.
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Mon Jul 29, 2019 5:03 pm
Reply with quote

Am I missing something ?
What I see is a CICS program running in BATCH ?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Mon Jul 29, 2019 6:27 pm
Reply with quote

That's probably something to be clarified -- SPOOL commands and the TDQ commands are only valid for CICS programs running in a CICS region.

varQon, you are not attempting to run your code in a batch job, right? If you are, then you need to abandon your futile effort.
Back to top
View user's profile Send private message
varQon

New User


Joined: 27 Jul 2019
Posts: 3
Location: India

PostPosted: Tue Jul 30, 2019 2:57 pm
Reply with quote

Hi Robert,

The BATCH is for running a C code but the batch itself needs
to be submitted either by SPOOL commands or by TDQ.

the (TDQ or SPOOL) code I have submitted above is itself embedded in another C program.
Back to top
View user's profile Send private message
John Poulakos

Active User


Joined: 13 Jun 2012
Posts: 178
Location: United States

PostPosted: Fri Aug 02, 2019 12:39 am
Reply with quote

The spool command must originate from a CICS program.
Code:
01  SPOOL-FIELDS.                                         
    03  SPOOL-TOKEN     PIC X(8)  VALUE LOW-VALUES.       
    03  SPOOL-NODE      PIC X(8)  VALUE 'LOCAL   '.       
    03  SPOOL-USERID    PIC X(8)  VALUE 'INTRDR  '.       
    03  SPOOL-CLASS     PIC X     VALUE 'A'.               
                                                           
01  CICS-80         PIC X(80)  VALUE SPACES.



Code:
EXEC CICS                         
     SPOOLOPEN OUTPUT             
          TOKEN  (SPOOL-TOKEN)   
          USERID (SPOOL-USERID)   
          NODE   (SPOOL-NODE)     
          CLASS  (SPOOL-CLASS)   
          PUNCH                   
          RESP   (CICS-RESP)     
          RESP2  (WS-RESP2)       
END-EXEC.

EXEC CICS SPOOLWRITE           
          TOKEN (SPOOL-TOKEN)   
          FROM  (CICS-80)       
          RESP  (CICS-RESP)     
          RESP2 (WS-RESP2)     
END-EXEC.   

EXEC CICS SPOOLCLOSE           
          TOKEN (SPOOL-TOKEN) 
          RESP  (CICS-RESP)   
          RESP2 (WS-RESP2)     
END-EXEC.                     


SPOOLWRITE is invoked for each JCL statement which is inserted in CICS-80. For simplification, have your job invoke a PROC, like this:

Code:
01  JCL-PROD.                                                   
    05  JCL-LINE1P     PIC X(56)  VALUE                         
    '//FS01B    JOB (CER01),CLASS=A,MSGCLASS=M,USER=CICSP    '.
    05  JCL-LINE2P     PIC X(56)  VALUE                         
    '//PROCS JCLLIB ORDER=(FS.ABACUS.MONTHLY.CTRL.LIBRARY)   '.
    05  JCL-LINE3P      PIC X(56)  VALUE                       
    '//STEP1    EXEC CERSUB1                                 '.
    05  JCL-LINE4P      PIC X(56)  VALUE                       
    '//STEP2    EXEC FS01B                                   '.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3049
Location: NYC,USA

PostPosted: Fri Aug 02, 2019 6:54 pm
Reply with quote

Quote:
as it is I get JCL error which is beyond me as I am new to mainframes. What should I do?

I think, Your CICS Site Support shall help you get the right JCL (If at all needed and allowed). Talk to them first and explain the situation.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CICS

 


Similar Topics
Topic Forum Replies
No new posts Search string in job at regular Spool... CLIST & REXX 0
No new posts Capturing logs from spool dd JCL & VSAM 6
No new posts Console Commands All Other Mainframe Topics 4
No new posts commands missing in JESMSGLG JCL & VSAM 3
No new posts No sysout coming in spool JCL & VSAM 4
Search our Forums:

Back to Top