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
 

 

problem with output datatset
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
sharad_shanu

New User


Joined: 03 Oct 2006
Posts: 40

PostPosted: Wed May 27, 2009 10:56 am    Post subject: problem with output datatset
Reply with quote

Hi all,

I am having a cobol program. The program takes input from a file and finally writes into output file. Then I am closing a file and invoking another JCL thru INTRDR before stop run. However I am getting JCL error for invoked JCL as input file not found.
I need to know whether output file in program would actually be available. I mean whether after stop run, after closing the file or any other execution. Please suggest.
Back to top
View user's profile Send private message

manishmittal

New User


Joined: 25 Apr 2008
Posts: 49
Location: Gurgaon

PostPosted: Wed May 27, 2009 2:17 pm    Post subject:
Reply with quote

One way to find this is after closing the file just try to read it immediately or you can make use of File-Status.Not sure though.
Back to top
View user's profile Send private message
sharad_shanu

New User


Joined: 03 Oct 2006
Posts: 40

PostPosted: Wed May 27, 2009 2:58 pm    Post subject:
Reply with quote

I am calling another proc which use a GENER taking this file as input. But I am getting error in GENER as "input file not found". So I guess, the file would be available after stop run. But I am not sure therefore I am seeking help in this regard.
Back to top
View user's profile Send private message
manishmittal

New User


Joined: 25 Apr 2008
Posts: 49
Location: Gurgaon

PostPosted: Wed May 27, 2009 3:04 pm    Post subject:
Reply with quote

My suggestion is again the same.After you closed the file just try to read it in the same code but after removing the GENER utiltity so that you can test on your own.
Suppose if file has been closed before stop run then you cannot read it and you will get file is not opened error OR if it is still not closed then you will be able to read it successfully.
Its just a test.
Back to top
View user's profile Send private message
sharad_shanu

New User


Joined: 03 Oct 2006
Posts: 40

PostPosted: Wed May 27, 2009 3:49 pm    Post subject:
Reply with quote

Please let me know how can read the file without opening it. We will surely get file status error code. I do not know any method by which a file can be read without opening it as you are suggesting.
Actually my requirement is simple, I need to know whether a file is available to outside for reading after stop run or closing the file.
Please excuse me if I sound offensive.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Wed May 27, 2009 3:52 pm    Post subject: Reply to: problem with output datatset
Reply with quote

are You sure that the jcl is written properly ?
Back to top
View user's profile Send private message
sharad_shanu

New User


Joined: 03 Oct 2006
Posts: 40

PostPosted: Wed May 27, 2009 4:20 pm    Post subject:
Reply with quote

yes...I am pretty much sure.... that's the basic GENER step...so I do not have any doubt about this.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Wed May 27, 2009 4:24 pm    Post subject:
Reply with quote

Does the file show up in 3.4
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Wed May 27, 2009 4:36 pm    Post subject: Reply to: problem with output datatset
Reply with quote

Quote:
input file not found

do You get a jcl error or what ?

I just reread your first post, You got a jcl error!
I trust jcl more than anybody else judgment,

up to now You did not post anything useful, to help You we need facts
please post the jcl used, and the jes log/sysout
Back to top
View user's profile Send private message
sharad_shanu

New User


Joined: 03 Oct 2006
Posts: 40

PostPosted: Wed May 27, 2009 5:34 pm    Post subject:
Reply with quote

Ok guys...let me clear the sky...
here is the requirement...I have an input file which is having records like:

NAVEEN524658764313576
216576464576764466767
257676545465765464465
NAVEEN24657654324463
255243434323434343433
NAVEEN16546461564989

I have to write group of records in output files based on some string.
For example, whenever the first 6 characters are 'NAVEEN' then it should write in separate files. Therefore very first record would go in first file. Records 2,3 and 4 will go to second file. Records 5 and 6 will be in third file and so on. There can be any number of 'NAVEEN' in input file.
Back to top
View user's profile Send private message
sharad_shanu

New User


Joined: 03 Oct 2006
Posts: 40

PostPosted: Wed May 27, 2009 5:38 pm    Post subject:
Reply with quote

The progrm I have written is:

IDENTIFICATION DIVISION.
PROGRAM-ID. TEST12.
AUTHOR. SHARAD SRIVASTAVA.

ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT INFILE ASSIGN TO INFILE.
SELECT OUTFILE ASSIGN TO OUTFILE.

DATA DIVISION.
FILE SECTION.

FD INFILE
LABEL RECORDS ARE STANDARD
RECORDING MODE IS F
BLOCK CONTAINS 0 RECORDS
DATA RECORD IS IN-REC.
01 IN-REC PIC X(080).

FD OUTFILE
LABEL RECORDS ARE STANDARD
RECORDING MODE IS F
BLOCK CONTAINS 0 RECORDS
DATA RECORD IS OUT-REC.
01 OUT-REC PIC X(080).

WORKING-STORAGE SECTION.
01 WS-SWITCHES.
05 NEWFILE-SW PIC X(01) VALUE 'Y'.
05 INFILE-EOF PIC X(01) VALUE 'N'.

PROCEDURE DIVISION.
0000-MAINLINE.
OPEN INPUT INFILE OUTPUT OUTFILE.
PERFORM 1111-READ UNTIL INFILE-EOF = 'Y'.
CLOSE INFILE OUTFILE.
STOP RUN.

1111-READ.
READ INFILE AT END MOVE 'Y' TO INFILE-EOF
END-READ
IF INFILE-EOF IS NOT EQUAL TO 'Y' THEN
PERFORM 2222-PROCESS
END-IF.

2222-PROCESS.
MOVE IN-REC TO OUT-REC
WRITE OUT-REC
IF IN-REC (1:6) = 'NAVEEN' THEN
PERFORM 3333-NEW
END-IF.

3333-NEW.
CLOSE OUTFILE
DISPLAY '//TEST12 JOB (PROD,0401,999,999,,4100),'
DISPLAY '// CLASS=D,MSGCLASS=8,'
DISPLAY '// REGION=0M'
DISPLAY '//STEPAA EXEC PGM=IEBGENER'
DISPLAY '//SYSIN DD DUMMY'
DISPLAY '//SYSUT1 DD DSN=TB@CSSVC.SHARAD.OUT,'
DISPLAY '// DISP=SHR'
DISPLAY '//SYSUT2 DD DSN=TB@CSSVC.SHARAD.TT(+1),'
DISPLAY '// DISP=(NEW,CATLG,DELETE),'
DISPLAY '// UNIT=DISK,'
DISPLAY '// SPACE=(CYL,(10,10),RLSE),'
DISPLAY '// DCB=RECFM=FB'
DISPLAY '//SYSPRINT DD SYSOUT=*'
DISPLAY '//SYSOUT DD SYSOUT=*'
DISPLAY '//*'.
DISPLAY '//STEPBB EXEC PGM=IEBGENER'
DISPLAY '//SYSIN DD DUMMY'
DISPLAY '//SYSUT1 DD DUMMY'
DISPLAY '//SYSUT2 DD DSN=TB@CSSVC.SHARAD.TT(+1),'
DISPLAY '// DISP=(NEW,CATLG,DELETE)'
DISPLAY '// UNIT=DISK,SPACE=(CYL,(1,5),RLSE),'
DISPLAY '// DCB=RECFM=FB'
DISPLAY '//SYSPRINT DD SYSOUT=*'
DISPLAY '//SYSOUT DD SYSOUT=*'
DISPLAY '//*'
OPEN OUTPUT OUTFILE.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Wed May 27, 2009 5:40 pm    Post subject:
Reply with quote

So what has that got to do with a "Missing" file

I think that Enrico was wanting some useful information like ...........

How are these files allocated.
How does the submitted JCL know which file to process.
Does the JCL error occur for every subsequent submitted job or only some.
Back to top
View user's profile Send private message
sharad_shanu

New User


Joined: 03 Oct 2006
Posts: 40

PostPosted: Wed May 27, 2009 5:40 pm    Post subject:
Reply with quote

The JCL is:

//TEST12 JOB (PROD,0401,999,999,,4100),'REEP-SAP EXT/FORMAT ',
// CLASS=D,MSGCLASS=8,NOTIFY=&SYSUID
//*
//STEP00 EXEC PGM=IEFBR14
//DD1 DD DSN=TB@CSSVC.SHARAD.OUT,
// DISP=(MOD,DELETE,DELETE)
//*
//STEP07 EXEC PGM=TEST12
//STEPLIB DD DISP=SHR,DSN=PB@OPERS.CMNSTG.WMCS.#003431.LOD
//SYSOUT DD SYSOUT=(*,INTRDR)
//SYSUDUMP DD SYSOUT=*
//INFILE DD DSN=TB@CSSVC.SHARAD.INP,DISP=SHR
//OUTFILE DD DSN=TB@CSSVC.SHARAD.OUT,DISP=(NEW,CATLG,DELETE),
// UNIT=(DISK,3),SPACE=(CYL,(10,10),RLSE)
//*
//STEP08 EXEC PGM=IEBGENER
//SYSIN DD DUMMY
//SYSUT1 DD DSN=TB@CSSVC.SHARAD.OUT,DISP=SHR
//SYSUT2 DD SYSOUT=*
//*
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7914
Location: Bellevue, IA

PostPosted: Wed May 27, 2009 5:49 pm    Post subject:
Reply with quote

Predefine TB@CSSVC.SHARAD.OUT and remove the delete step in your JCL. Data sets are not cataloged until the end of the step; you are attempting to use a cataloged data set in the middle of the step that creates the data set. This, by definition, will fail.
Back to top
View user's profile Send private message
sharad_shanu

New User


Joined: 03 Oct 2006
Posts: 40

PostPosted: Wed May 27, 2009 6:17 pm    Post subject:
Reply with quote

Done. Job shows that it is completing with MAX CC =00 but no version of GDG is created.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7914
Location: Bellevue, IA

PostPosted: Wed May 27, 2009 6:21 pm    Post subject:
Reply with quote

Sigh. First problem solved. Second one starts.

What output and error messages (if any) show up for TEST12 job (the one you submit via internal reader)?
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Wed May 27, 2009 6:25 pm    Post subject:
Reply with quote

sharad_shanu wrote:
Done. Job shows that it is completing with MAX CC =00 but no version of GDG is created.

Unfortunately today is not psychic day, so would you care to tell us where the GDG GENERATION should have been created.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7914
Location: Bellevue, IA

PostPosted: Wed May 27, 2009 6:30 pm    Post subject:
Reply with quote

Quote:
Unfortunately today is not psychic day
Was it yesterday?
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Wed May 27, 2009 6:31 pm    Post subject:
Reply with quote

Not that I fore saw
Back to top
View user's profile Send private message
sharad_shanu

New User


Joined: 03 Oct 2006
Posts: 40

PostPosted: Wed May 27, 2009 6:40 pm    Post subject:
Reply with quote

I aplogize but I am using internal reader and the invoked JCL is supposed to create GDG. Please have a look at cobol code.
There is no error message. GDG versions are created but the first is having only one record (last record) and rest all versions are empty. Also JCL shows only one step of the GDG creation (STEPAA). I am not too sure but it might be linked with closure and opening of file before each JCL.
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
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm
No new posts Syncsort - Hard coded Value in output PORYES SYNCSORT 1 Thu Nov 03, 2016 9:23 am
No new posts Problem in Running Query via JCL vickey_dw DB2 3 Tue Oct 18, 2016 11:11 pm
No new posts output data in CSV Format janmejay COBOL Programming 8 Sat Oct 15, 2016 2:20 pm
This topic is locked: you cannot edit posts or make replies. output data in CSV Format janmejay DFSORT/ICETOOL 3 Sat Oct 15, 2016 2:16 pm


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