Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Opening and writing a file without DDNAME in COBOL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Opening and writing a file without DDNAME in COBOL
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: 785
Location: Chennai, India

PostPosted: Thu Apr 12, 2012 4:09 pm    Post subject:
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    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Thu Apr 12, 2012 5:00 pm    Post subject: Reply to: Opening and writing a file without DDNAME in COBOL
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    Post subject:
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    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Thu Apr 12, 2012 5:58 pm    Post subject: Reply to: Opening and writing a file without DDNAME in COBOL
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: 7904
Location: Bellevue, IA

PostPosted: Thu Apr 12, 2012 6:05 pm    Post subject:
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: 641
Location: Whitby, ON, Canada

PostPosted: Fri Apr 13, 2012 7:31 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
This topic is locked: you cannot edit posts or make replies. Natural ADABAS Opening with CTS enikhilk Mainframe Jobs 0 Wed Nov 30, 2016 5:37 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us