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

Opening and writing a file without DDNAME in COBOL


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
vishalbshah

New User


Joined: 01 Dec 2006
Posts: 61
Location: Pune

PostPosted: Thu Apr 12, 2012 4:01 pm
Reply with quote

Hi,

I have written a COBOL program which prepares an OUTPUT file with Customer details.

The File is OPENed in OUTPUT mode.

Just to check error logging of the program I have commented DDNAME from JCL for this file I was thinking this may result in unsuccessful FILE Operation while OPEN or while WRITE.

Strange thing is the program without DDNAME (commented out) in JCL got Executed successfully and I could see record processed displayed in SYSOUT.

I am aware of OPTIONAL Clause while SELECT statement in FILE Control Paragraph. I have not specified this file as OPTIONAL.

Could someone please, suggest is OPTIONAL a default clause?

OR

Is it something specific about Files opened in OUTPUT mode ?
Back to top
View user's profile Send private message
Gnanas N

Active Member


Joined: 06 Sep 2007
Posts: 792
Location: Chennai, India

PostPosted: Thu Apr 12, 2012 4:09 pm
Reply with quote

Possibly, your JES2/JES3 allocated that data set as temporary one and got deleted at end of the STEP.

Try searching JOBLOG with DDNAME.
Back to top
View user's profile Send private message
vishalbshah

New User


Joined: 01 Dec 2006
Posts: 61
Location: Pune

PostPosted: Thu Apr 12, 2012 4:27 pm
Reply with quote

Yes,

That's right my JES2 subsystem is allocating temporary files for that DDNAME

IGD101I SMS ALLOCATED TO DDNAME(FSURQST )
DSN (SYS12103.T102235.RA000.TCSS0DS0.R0126328 )
STORCLAS (TEMPVIO) MGMTCLAS ( ) DATACLAS ( )
VOL SER NOS= VIO

looks like it is specific for the File Opened in OUTPUT mode.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Apr 12, 2012 5:00 pm
Reply with quote

Can you show the full message output from the step please?
Back to top
View user's profile Send private message
vishalbshah

New User


Joined: 01 Dec 2006
Posts: 61
Location: Pune

PostPosted: Thu Apr 12, 2012 5:39 pm
Reply with quote

JESYSMSG :

Code:


IEF236I ALLOC. FOR TCSVBSS0 CDGTSPB1                                           
IGD103I SMS ALLOCATED TO DDNAME JOBLIB                                         
IGD103I SMS ALLOCATED TO DDNAME                                               
IGD103I SMS ALLOCATED TO DDNAME                                               
IGD103I SMS ALLOCATED TO DDNAME                                               
IGD103I SMS ALLOCATED TO DDNAME                                               
IEF237I JES2 ALLOCATED TO SYSPRINT                                             
IEF237I JES2 ALLOCATED TO SYSTSPRT                                             
IEF237I JES2 ALLOCATED TO SYSOUT                                               
IEF237I JES2 ALLOCATED TO SYSABOUT                                             
IEF237I JES2 ALLOCATED TO SYSDBOUT                                             
IEF237I JES2 ALLOCATED TO SYSTSIN                                             
IGD101I SMS ALLOCATED TO DDNAME (FSURQST )                                     
        DSN (SYS12103.T130606.RA000.TCSVBSS0.R0295913    )                     
        STORCLAS (TEMPVIO) MGMTCLAS (        ) DATACLAS (        )             
        VOL SER NOS= VIO                                                       


sysout

Code:

*************!!!!!!!!!!!!!!!!!!!!!!!!************         
         FSU DATA GATHERER STARTED AT                     
         2012-04-12-13.06.04.963355                       
                                                           
*************!!!!!!!!!!!!!!!!!!!!!!!!************         
*************!!!!!!!!!!!!!!!!!!!!!************             
         CDGU61B1 COMPLETED SUCCESSFULLY                   
         STATISTICS MENTIONED BELOW                       
*************!!!!!!!!!!!!!!!!!!!!!************             
                                                           
TOTAL NUMBER OF FSU DETAILED RECORD WRITTEN =             
0000000003                                                 
                                                           
*************!!!!!!!!!!!!!!!!!!!!!!!!************         
         FSU DATA GATHERER ENDED AT                       
        2012-04-12-13.06.08.764000                         
                                                           
*************!!!!!!!!!!!!!!!!!!!!!!!!************         
Back to top
View user's profile Send private message
vishalbshah

New User


Joined: 01 Dec 2006
Posts: 61
Location: Pune

PostPosted: Thu Apr 12, 2012 5:41 pm
Reply with quote

JCL

Code:

//TCSVBSS0 JOB 0000,'VISHAL B',CLASS=D,MSGCLASS=X,NOTIFY=&SYSUID,       
//             REGION=0M,MSGLEVEL=(1,1)                                 
//* $ACFJ219 ACF2 ACTIVE I003                                           
//* $ACFJ219 ACF2 ACTIVE I003                                           
//*---------------------------------------------------------------------
//* DUASP000 (SERVICE PORTAL) AND DUAAA TEST HARNESS                   
//* JCL FOR SANITY TEST REGIONALISATION PHASE 2                         
//*---------------------------------------------------------------------
//JOBLIB   DD DSN=TCS.TEST.SUPRIYO.LOADLIB,DISP=SHR                     
//         DD DSN=LNDV.OPUT.PROD.B.CDUG.B012.LOADLIB,DISP=SHR           
//         DD DSN=DB2.SYS.LOAD,DISP=SHR                                 
//         DD DSN=DB2.SYS.DSNLOAD,DISP=SHR                             
//         DD DSN=LNDV.OPUT.PROD.B.GSI.B.LOADLIB,DISP=SHR               
//*---------------------------------------------------------------------
//*---------------------------------------------------------------------
//CDGTSPB1 EXEC PGM=IKJEFT01,DYNAMNBR=20                               
//*FSURQST  DD DSN=TCS.TEST.FSU.RQST.FILE,                             
//*            DISP=SHR                                                 
//SYSPRINT DD SYSOUT=*                                                 
//SYSTSPRT DD SYSOUT=*                                                 
//SYSOUT   DD SYSOUT=*                                                 
//SYSABOUT DD SYSOUT=*                                                 
//SYSDBOUT DD SYSOUT=*                                                 
//SYSTSIN  DD *                                                         
  DSN SYSTEM(TB0A)                                                     
  RUN PROGRAM(CDGU61B1) PLAN(CUDUTGBB) PARMS ('FATCA                 ')
  END                                                                   
/*                                                                     
               
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Apr 12, 2012 5:58 pm
Reply with quote

Thanks, I was curious. Yes, it looks lie TSO-in-batch is allocating the DD, the message for that is different, and it comes after the JES allocations.

There is probably some way to turn it off.

Just as a note, I always leave a blank after "//*" in JCL. I don't want to suddenly coincide with a JES command one day :-)
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Thu Apr 12, 2012 6:05 pm
Reply with quote

OPTIONAL is not a default for SELECT, although of course your site could have changed it since each site can set default compile options.

However, I think what is more likely going on is that COBOL has been enhanced over the last few years to allow the SELECT ASSIGN to point to either a DD name OR an enviornment variable. For an output file, even though the DD name is not present, the program and operating system have enough information to allocate the output data set (with the default disposition of NEW,DELETE as usual). You may not have expected this behavior, but it is not unusual by any means.
Back to top
View user's profile Send private message
don.leahy

Active Member


Joined: 06 Jul 2010
Posts: 765
Location: Whitby, ON, Canada

PostPosted: Fri Apr 13, 2012 7:31 am
Reply with quote

Is the CBLQDA run time option in effect? If so, then that would explain the behavior reported by the TS.
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Binary File format getting change whi... All Other Mainframe Topics 7
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top