Charles:
 
I get what your saying, this is a test program ..I understand, this is why I am 
asking ok  ?
This is why one asks questions of their collegues..
 
At least where I grew up in corn country .....

Scott J Ford
Software Engineer
http://www.identityforge.com/
 
 

________________________________
 From: Charles Mills <charl...@mcn.org>
To: IBM-MAIN@LISTSERV.UA.EDU 
Sent: Wednesday, September 5, 2012 10:48 AM
Subject: Re: The IBM zEnterprise EC12 announcment
  
dest needs to be 23 chars long in order to hold 22 usable characters plus a 
terminator.

This is the hazard of strcpy and strcat. You have a real hazardous program 
here. What if I executed it with 
PARM='NOWISTHETIMEFORALLGOODMEN TOCOMETOTHEAIDOFTHEPARTY'
?

Look into STL std::string.

Charles

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf 
Of Scott Ford
Sent: Wednesday, September 05, 2012 7:18 AM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: The IBM zEnterprise EC12 announcment

Here my example I was referring to initially..

Execution JCL:

//REXXC   JOB SYSTEMS,CLASS=A,MSGCLASS=X, //      
MSGLEVEL=(1,1),REGION=4096K,NOTIFY=&SYSUID
//STEP1   EXEC  PGM=TESTR1,PARM=('USER AA1122BB') //STEPLIB  DD 
DISP=SHR,DSN=SFORD.LINKLIB //SYSEXEC  DD DISP=SHR,DSN=IDF.CLISTLIB //SYSTSPRT 
DD SYSOUT=* //SYSPRINT DD SYSOUT=* //SYSUDUMP DD SYSOUT=* //SYSTSIN  DD DUMMY
/*
-----------------------------
C Program 

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct IRXJCL_type
{
  short int arg_length;
  char argument[22];
} IRXJCL_type;
IRXJCL_type this_param;
IRXJCL_type* param_ptr;
main(int argc, char *argv[])
  {
    char dest[22];
    int i = 1;
    int s1;
    memset(this_param.argument,'',sizeof(this_param.argument));
    strcpy(dest,"IDFRACFC ");
    strcat(dest,argv[1]);
    strcat(dest," ");
    strcat(dest,argv[2]);
    strcat(dest," ");
    strcpy(this_param.argument,dest);
    puts(this_param.argument);
}
Output of Execution:
                       J E S 2  J O B  L O G  --  S Y S T E M  A D C D  --  N O

08.13.47 JOB00170 ---- WEDNESDAY, 05 SEP 2012 ----
08.13.47 JOB00170  IRR010I  USERID SFORD    IS ASSIGNED TO THIS JOB.
08.13.47 JOB00170  ICH70001I SFORD    LAST ACCESS AT 08:09:12 ON WEDNESDAY, SEPT
08.13.47 JOB00170  $HASP373 REXXC    STARTED - INIT 1    - CLASS A - SYS ADCD
08.13.47 JOB00170  IEF403I REXXC - STARTED - TIME=08.13.47
08.13.48 JOB00170  IEF404I REXXC - ENDED - TIME=08.13.48
08.13.48 JOB00170  $HASP395 REXXC    ENDED
------ JES2 JOB STATISTICS ------
  05 SEP 2012 JOB EXECUTION DATE
           10 CARDS READ
           51 SYSOUT PRINT RECORDS
            0 SYSOUT PUNCH RECORDS
            3 SYSOUT SPOOL KBYTES
         0.01 MINUTES EXECUTION TIME
         //      MSGLEVEL=(1,1),REGION=4096K,NOTIFY=&SYSUID
          IEFC653I SUBSTITUTION JCL - SYSTEMS,CLASS=A,MSGCLASS=X,MSGLEVEL=(1,1),
        2 //STEP1   EXEC  PGM=TESTR1,PARM=('USER AA1122BB')
        3 //STEPLIB  DD DISP=SHR,DSN=SFORD.LINKLIB
        4 //SYSEXEC  DD DISP=SHR,DSN=IDF.PROD.ORA9421.CLISTLIB
        5 //SYSTSPRT DD SYSOUT=*
        6 //SYSPRINT DD SYSOUT=*
        7 //SYSUDUMP DD SYSOUT=*
        8 //SYSTSIN  DD DUMMY
          /*
ICH70001I SFORD    LAST ACCESS AT 08:09:12 ON WEDNESDAY, SEPTEMBER 5, 2012 
IEF236I ALLOC. FOR REXXC STEP1 IEF237I 0A82 ALLOCATED TO STEPLIB IEF237I 0AA1 
ALLOCATED TO SYSEXEC IEF237I JES2 ALLOCATED TO SYSTSPRT IEF237I JES2 ALLOCATED 
TO SYSPRINT IEF237I JES2 ALLOCATED TO SYSUDUMP IEF237I DMY  ALLOCATED TO 
SYSTSIN IEF142I REXXC STEP1 - STEP WAS EXECUTED - COND CODE 0000 IEF285I   
SFORD.LINKLIB                                KEPT IEF285I   VOL SER NOS= ZCSYS1.
IEF285I   IDF.PROD.ORA9421.CLISTLIB                    KEPT IEF285I   VOL SER 
NOS= IDF001.
IEF285I   SFORD.REXXC.JOB00170.D0000101.?              SYSOUT IEF285I   
SFORD.REXXC.JOB00170.D0000102.?              SYSOUT IEF285I   
SFORD.REXXC.JOB00170.D0000103.?              SYSOUT IEF373I STEP/STEP1   /START 
2012249.0813 IEF032I STEP/STEP1   /STOP  2012249.0813
        CPU:     0 HR  00 MIN  00.26 SEC    SRB:     0 HR  00 MIN  00.00 SEC
        VIRT:    60K  SYS:   476K  EXT:     8264K  SYS:    11340K IEF375I  
JOB/REXXC   /START 2012249.0813 IEF033I  JOB/REXXC   /STOP  2012249.0813
        CPU:     0 HR  00 MIN  00.26 SEC    SRB:     0 HR  00 MIN  00.00 SEC
  
IDFRACFC USER AA1122BB

Without the memset in this example the C code fails. I am not the C heavy a lot 
of folks are here, but the ILC manual pretty much shows the same thing in 
examples going from C -> Cobol -> C ..

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to