Question

Can anybody show me examples on how to pass to a c program the parameters from SYSIN DD * in JCL.

I used to have my JCL program pass the parameter to a c program using the PARM option, but the PARM option has a 100 character limit, thus, requiring me to use the SYSIN DD * option in JCL instead. However, my old c program uses the argv paramater passing style and I don't know if this would still apply when using SYSIN DD *.


This is what my old JCL code looks like:

/ SET P1='RBR1 FIRBS.AIC_REHBFG_FDG.BM '                                        
// SET P2='BGM.LOL_FDSG '                                                       
// SET P3='"" '                                                                 
// SET P4='X F GMHKD'                                                           
//ST01    EXEC PGM=VCMBGJF,                                                     
//PARM='&P1.&P2.&P3.&P4' 

This is what my new JCL code looks like:

//ST01    EXEC PGM=VCMBGJF
//SYSIN    DD *    
RBR1 FIRBS.AIC_REHBFG_FDG.BM                                       
BGM.LOL_FDSG                                                      
""                                                               
X F GMHKD
/* 
Was it helpful?

Solution

Have you tried reading STDIN and if so does it return data from SYSIN, or try opening SYSIN, as fp = fopen("SYSIN", "r");

Alternatively, try changing the DD name of SYSIN to STDIN. The DD * says to pull the data from the text lines that follow. It does NOT have to be named SYSIN.

Finally, if all else fails read the C/Mainframe user guide. (I don't have one and it was a long time ago when I wrote on a mainframe, so I forget the particulars.)

Lastly, the first example seems to have a few errors:

// SET P1='RBR1 FIRBS.AIC_REHBFG_FDG.BM '                                        
// SET P2='BGM.LOL_FDSG '                                                       
// SET P3='"" '                                                                 
// SET P4='X F GMHKD'                                                           
//ST01    EXEC PGM=VCMBGJF,PARM='&P1.&P2.&P3.&P4'
//* there should be a space between // and PARM 

I mention this because the parm data you listed is < 100 chars, so fixing the PARM statement might fix the running of your code.

OTHER TIPS

You could use the CEE3PR2 Language Environment callable service. Its purpose is to return parm strings of greater than 80 bytes [sic] to invoking programs. I believe this is new to z/OS 1.13. Note that this is not portable to non-mainframe systems. Of course, neither is JCL.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top