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
 

 

Writing record from second column of file!!!
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
Angeline

New User


Joined: 22 Jul 2010
Posts: 10
Location: India

PostPosted: Fri Apr 01, 2011 12:10 pm    Post subject: Writing record from second column of file!!!
Reply with quote

Hey

I'm writing a record of lenth 117 in a file. The below is the DD card for the output file in the JCL.

//IHSTEXCP DD DSN=XXXXXX.MASTIHST.EXCD,
// DISP=(NEW,CATLG,CATLG),
// DCB=(DSORG=PS,RECFM=FB,LRECL=117,BLKSIZE=0),
// UNIT=SMALL,SPACE=(TRK,(200,10),RLSE)

When I open the output file, the 1st column of all the records are blank. ideally it should have value. But When i tried displaying the record in the COBOL code. I'm getting proper data.

Can anyone please tell me what would have gone wrong ? why column 1 is getting blanked ?

Thanks
Angeline
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Apr 01, 2011 12:13 pm    Post subject:
Reply with quote

the 4th instruction in the write section has a problem.
Back to top
View user's profile Send private message
Angeline

New User


Joined: 22 Jul 2010
Posts: 10
Location: India

PostPosted: Fri Apr 01, 2011 12:16 pm    Post subject:
Reply with quote

you mean to say
// UNIT=SMALL,SPACE=(TRK,(200,10),RLSE) has some problem ?
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Fri Apr 01, 2011 12:33 pm    Post subject: Reply to: Writing record from second column of file!!!
Reply with quote

define blank and proper data

when You say open I guess that You really mean something like ISPF browse , don' t You ?

use HEX on and tell us what You see !

using the exact terminology is essential for good communication and understanding!
Back to top
View user's profile Send private message
Angeline

New User


Joined: 22 Jul 2010
Posts: 10
Location: India

PostPosted: Fri Apr 01, 2011 12:41 pm    Post subject:
Reply with quote

The proper data is something like this.
Code:
23032972002002 XXXXX XXXX XXXX


But the output I'm getting is
Code:
 3032972002002 XXXXX XXXX XXXX


So the tow is being replaced with Blank. When I open the file is Dsu 4, and put hex on, I get the below data.

Code:
 3032972002002 3032972002        SUS  SUS-SSID
4FFFFFFFFFFFFF4FFFFFFFFFF44444444EEE44EEE6EECC
0303297200200203032972002000000002420024202294

Hope I made the pbm sound clear.

Thanks
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Fri Apr 01, 2011 12:51 pm    Post subject: Reply to: Writing record from second column of file!!!
Reply with quote

what the heck is Dsu 4 ? icon_evil.gif

and how does the HEX data relate to the other two ?

and
Quote:
But When i tried displaying the record in the COBOL code.
what does it mean ?
Back to top
View user's profile Send private message
Angeline

New User


Joined: 22 Jul 2010
Posts: 10
Location: India

PostPosted: Fri Apr 01, 2011 12:55 pm    Post subject:
Reply with quote

i mean in ISPF. Sorry!!!
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Apr 01, 2011 1:51 pm    Post subject:
Reply with quote

well we now know everything except
  • control cards?
  • example of input data records
  • example of expected output datarecords


probably time to address the issue - incorrect sort control card
instead of spending time listening to your analysis. (have you noticed the first 4 letters of analysis?)
Back to top
View user's profile Send private message
Angeline

New User


Joined: 22 Jul 2010
Posts: 10
Location: India

PostPosted: Fri Apr 01, 2011 2:55 pm    Post subject:
Reply with quote

1. No control card is used.
2. I have two input files which are processed and the output records are written in a file of fixed size using cobol code.
3. The output records is expected to look as
23032972002002 XXXXX XXXX XXXX

but what I'm getting in the file is
b3032972002002 XXXXX XXXX XXXX

where b in red is blank.
Back to top
View user's profile Send private message
Angeline

New User


Joined: 22 Jul 2010
Posts: 10
Location: India

PostPosted: Fri Apr 01, 2011 2:58 pm    Post subject:
Reply with quote

When I give display command in teh COBOL code just before the code writes the records into the file, I'm getting the expected output.

But once wriirten in the file, when I check the file, I have all banks in the 1st column of the file.

I dont understand which 4letters you are talking about ?

Thanks
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1714
Location: UK

PostPosted: Fri Apr 01, 2011 3:01 pm    Post subject:
Reply with quote

Why are you posting this in the dfsort forum if it is a cobol program? You were asked questions, and had comments mde, that were relevant for a sort question. You have not only wated your time but that of several other people.
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: Fri Apr 01, 2011 3:14 pm    Post subject:
Reply with quote

Topic moved to COBOL forum
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Apr 01, 2011 3:39 pm    Post subject:
Reply with quote

ok- COBOL problem.

1. need to analyse (we need to see - please cut & paste) the
  • FD definition
  • Cobol display statement
  • write statement
  • relevent Structure definitions
Back to top
View user's profile Send private message
Angeline

New User


Joined: 22 Jul 2010
Posts: 10
Location: India

PostPosted: Fri Apr 01, 2011 3:57 pm    Post subject:
Reply with quote

Please find the details.

1. FD IHSTEXCP
LABEL RECORDS ARE STANDARD
RECORDING MODE IS F
BLOCK CONTAINS 0 RECORDS.

01 IHSTEXCP-REC PIC X(117).

2. WRITE IHSTEXCP-REC FROM WS-IHSTEXCP-DTL
3. 01 WS-IHSTEXCP-DTL.
05 WS-EXCP-BXX PIC X(14) VALUE SPACES.
05 FILLER PIC X(01) VALUE SPACES.
05 WS-EXCP-WXX PIC X(10) VALUE SPACES.
05 FILLER PIC X(01) VALUE SPACES.
05 WS-EXCP-UXXX PIC X(05) VALUE SPACES.
05 FILLER PIC X(01) VALUE SPACES.
05 WS-EXCP-DESC PIC X(43) VALUE SPACES.
05 FILLER PIC X(01) VALUE SPACES.
05 WS-EXCP-MSG PIC X(40) VALUE SPACES.
05 FILLER PIC X(01) VALUE SPACES.

4. DISPLAY "B4 WRITE EXCP: "WS-IHSTEXCP-DTL
WRITE IHSTEXCP-REC FROM WS-IHSTEXCP-DTL
DISPLAY "AFTER WRITE EXCP: "WS-IHSTEXCP-DTL


Also, in the JCL, for the output file DD card, the file type is specified as FB.

//IHSTEXCP DD DSN=XXXXXX.MASTIHST.EXCD,
// DISP=(NEW,CATLG,CATLG),
// DCB=(DSORG=PS,RECFM=FB,LRECL=117,BLKSIZE=0),
// UNIT=SMALL,SPACE=(TRK,(200,10),RLSE)

But when i checked the output file created, it was of type FBA.

Thanks
Angeline
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Fri Apr 01, 2011 4:44 pm    Post subject:
Reply with quote

The first byte of an FBA file will always be the carriage control byte -- blank for single space, 0 for double space, 1 for top of form, + for overprint, and so forth. So the mystery of where your first byte is going is resolved -- it is being changed to space for carriage control.

Now the question becomes, why is the file FBA instead of FB? What does your SELECT statement look like?
Back to top
View user's profile Send private message
Angeline

New User


Joined: 22 Jul 2010
Posts: 10
Location: India

PostPosted: Fri Apr 01, 2011 4:58 pm    Post subject:
Reply with quote

that looks simple though...

SELECT IHSTEXCP ASSIGN TO UT-S-IHSTEXCP.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Fri Apr 01, 2011 5:07 pm    Post subject:
Reply with quote

How many WRITE statements for the file are in the program? Do any of them have the AFTER phrase?
Back to top
View user's profile Send private message
Angeline

New User


Joined: 22 Jul 2010
Posts: 10
Location: India

PostPosted: Fri Apr 01, 2011 6:14 pm    Post subject:
Reply with quote

The WRITE statement is used quite a few times for writing header, footer and data. But none of the WRTIE has AFTER phrase.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Fri Apr 01, 2011 6:35 pm    Post subject:
Reply with quote

Is the ADV compile option set? If so , use NOADV and try again.
Back to top
View user's profile Send private message
Jose Mateo

Active User


Joined: 29 Oct 2010
Posts: 110
Location: Puerto Rico

PostPosted: Fri Apr 01, 2011 7:16 pm    Post subject:
Reply with quote

Good day to all!

In your DCB the BLKSIZE should be 117 because you have one record per block and your LRECL is 117 which in this case the BLKSIZE equal LRECL.
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 Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 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
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm


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