Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
How Calling IDCAMS From PL/I

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
View previous topic :: :: View next topic  
Author Message
treize59

New User


Joined: 15 Mar 2006
Posts: 2

PostPosted: Thu Mar 16, 2006 3:24 pm    Post subject: How Calling IDCAMS From PL/I
Reply with quote

Hi,

I want to call IDCAMS from PL/I. IDCAMS is in RM=24 and AM=ANY, my program is in AM=31 and RM=ANY. I searched some doc about this and i found some sample in asm (http://www.itc.virginia.edu/~drs8h/articles/idcupdt.txt) and cobol (http://www.naspa.com/PDF/2000/0100%20TS%20PDFs/T0001006.pdf) but none in PL/I.

When i run my program in mode 24 (stack=below in JCL), the return code is ok.
But, when i run my program in mode 31, i have an abend S0C4-4.

I think my problem is in the parameters to call IDCAMS.

here is the code:

Code:

 CALLIDC: PROC (ZPARM) OPTIONS (MAIN) REORDER;                         
 DCL (PLIRETC, ADDR, UNSPEC) BUILTIN;                                   
 DCL SORTIE CHAR (80) INIT ('');                                       
 DCL ZPARM  CHAR (100) VAR;                                             
 DCL Q      CHAR (1)  INIT ('''');                                     
 DCL FILPRNT  FILE PRINT;                                               
 DCL SYSPRINT FILE PRINT;                                               
 DCL FILOUT  FILE RECORD OUTPUT;                                       
 DCL CC  FIXED BIN (31) INIT (0);  /* CODE RETOUR S/P */               
 DCL RC  FIXED BIN (31) INIT (0);                                       
 DCL IDCAMS EXT ENTRY                                                   
   (FIXED BIN(15), CHAR(*)                                             
   ,FIXED BIN(15)                                                       
   ,BIT(8) ,BIT(8) ,BIT(8) ,BIT(8)                                     
   ,CHAR(*) ,CHAR(*)  );                                               
                                                                       
 DCL 1 CTPARM,                                                         
       2 OPT,                                                           
         3 L1 FIXED BIN (15) INIT (0),                                 
         3 OPL CHAR (4) INIT ('');                                     
 DCL 1 CTDDN,                                                           
       2 DDN,                                                           
         3 L2 FIXED BIN (15) INIT (72),                                 
         3 DIV,                                                         
           4 B01 BIT (8) INIT ('0'B),                                   
           4 B02 BIT (8) INIT ('0'B),                                   
           4 B03 BIT (8) INIT ('0'B),                                   
           4 B04 BIT (8) INIT ('0'B),                                   
           4 DD1 CHAR (8) INIT ('SYSIN'),                               
           4 DD2 CHAR (8) INIT ('SYSPRINT');                           
                                                                       
 OPEN FILE (FILPRNT);                                                   
 PUT SKIP FILE (FILPRNT) EDIT                                           
   ('DEBUT DE TRAITEMENT (CALLIDC)') (A);                               
 OPEN FILE (FILOUT) TITLE('SYSIN');                                     
 SORTIE = ' REPRO IDS(' !! Q !!                                         
          'GLLLBND.SYSP.SA01.RESULTS.DATA(I31F2341)' !! Q !! ') -' ;   
 WRITE FILE (FILOUT) FROM (SORTIE);                                     
 SORTIE = '       OUTFILE(TEMP)';                                       
 WRITE FILE (FILOUT) FROM (SORTIE);                                     
 CLOSE FILE (FILOUT);                                                   
 FETCH IDCAMS;                                                         
 CALL IDCAMS (CTPARM.L1, CTPARM.OPL                                     
   , CTDDN.L2, CTDDN.B01, CTDDN.B02, CTDDN.B03, CTDDN.B04               
   , CTDDN.DD1, CTDDN.DD2);                                             
 PUT SKIP DATA (CC);                                                   
 PUT SKIP FILE (FILPRNT) EDIT                                           
   ('FIN   DE TRAITEMENT (CALLIDC)') (A);                               
 CLOSE FILE (FILPRNT);                                                 
 CALL PLIRETC (RC);                                                     
 END CALLIDC;                                                           
[/quote]
Back to top
View user's profile Send private message

wcorsar

New User


Joined: 15 Jul 2006
Posts: 6
Location: Florida

PostPosted: Sat Jul 15, 2006 3:02 am    Post subject: How to call IDCAMS from PL/1
Reply with quote

Here's and example of code we used to accomplish the same thing. Note the difference in the DCL for IDCAMS, the definition of the PARM structure and the call. (Do not pass OPL parameter.)

Hope this helps.

CALLIDC: PROCEDURE OPTIONS(MAIN) REORDER;
DCL IDCAMS EXTERNAL ENTRY OPTIONS (ASM,INTER);
DCL SORTIE CHAR(80) INIT ('');
DCL Q CHAR (1) INIT ('''');
DCL FILOUT FILE RECORD OUTPUT;

DCL 1 CTPARM,
2 OPT,
3 L1 FIXED BIN (15) INIT (0),
3 OPL CHAR (4) INIT('');

DCL 1 CTDDN,
2 DDN,
3 L2 FIXED BIN (15) INIT (48),
3 DIV,
4 B01 CHAR(8) INIT (LOW(8)),
4 B02 CHAR(8) INIT (LOW(8)),
4 B03 CHAR(8) INIT (LOW(8)),
4 B04 CHAR(8) INIT (LOW(8)),
4 DD1 CHAR (8) INIT ('SYSIN '),
4 DD2 CHAR (8) INIT ('SYSPRINT');

OPEN FILE (FILOUT) TITLE('SYSIN');
SORTIE =
' REPRO IDS(TEST.PLI.IDCAMS.IN) -';
WRITE FILE (FILOUT) FROM (SORTIE);

SORTIE =
' ODS(TEST.PLI.IDCAMS.OUT)';
WRITE FILE (FILOUT) FROM (SORTIE);

CLOSE FILE (FILOUT);
FETCH IDCAMS;

CALL IDCAMS (CTPARM.L1,
CTDDN.L2,
CTDDN.B01,
CTDDN.B02,
CTDDN.B03,
CTDDN.B04,
CTDDN.DD1,
CTDDN.DD2);

RELEASE IDCAMS;
END CALLIDC;
Back to top
View user's profile Send private message
treize59

New User


Joined: 15 Mar 2006
Posts: 2

PostPosted: Mon Jul 17, 2006 1:33 pm    Post subject: Re: How Calling IDCAMS From PL/I
Reply with quote

Thank you,

I have found why my job is in error. If I code STACK(,,BELOW) instead of STACK(,,ANY) to LE/370, I have a RC=0.

If I code STACK(,,ANY), I'll
It's normal, because IDCAMS is in AM=ANY and RM=24.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts IDCAMS Allocate & Repro pahiker JCL & VSAM 9 Thu Aug 24, 2017 7:28 pm
No new posts Calling CLIST through job and REXX Sahasra K CLIST & REXX 19 Tue Aug 01, 2017 10:25 am
No new posts VSAM RLS=NRI while doing IDCAMS sheersh JCL & VSAM 1 Tue Mar 07, 2017 1:55 pm
No new posts Calling procedure with multiple entri... steve-myers PL/I & Assembler 5 Fri Jan 27, 2017 3:33 pm
This topic is locked: you cannot edit posts or make replies. Calling REXX code from ISPF panel sanchita dey TSO/ISPF 4 Mon Jan 02, 2017 5:13 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us