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
 

 

Values not writing into o/p file properly
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
Vidya Kajale

New User


Joined: 01 Jun 2010
Posts: 43
Location: India

PostPosted: Thu Jun 02, 2011 11:03 am    Post subject: Values not writing into o/p file properly
Reply with quote

Hi ,
The value of field RPT3-REC-TYPE is not coming properly in o/p file. It is truncating 1st byte in some case and in some case it printing correctly.
Code:
20 REPORT-3-KEY-AREA.                             
   25 RPT3-REC-TYPE           PIC X(02).           
   25 RPT3-REC-TYPE-FL        PIC X(01) VALUE ';'.
   25 RPT3-PROC-MTH           PIC X(08).           
   25 RPT3-PROC-MTH-FL        PIC X(01) VALUE ';'.
   25 RPT3-DLR                PIC X(06).           
   25 RPT3-DLR-FL             PIC X(01) VALUE ';'.
   25 RPT3-COMPANY-CODE       PIC X(01).           
   25 RPT3-COMPANY-CODE-FL    PIC X(01) VALUE ';'.
   25 RPT3-ADDRESS            PIC X(35).           

In procedure division we are moving the following values in multiple places.
MOVE '02' TO RPT3-REC-TYPE
MOVE '03' TO RPT3-REC-TYPE
Finally we are writings into output file. As RPT3-REC-TYPE is pic X(2) hence it should contain either ‘02’ or ‘03’ in 1st two positions.
We verify the Output file. The 1st two byte contains ‘2’ instead of ‘03’. For 03 it’s writing into output file as ‘03’. Please suggest us what‘s the actual problem is.

the attachment has been deleted

Please suggest me suitable way.
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7226

PostPosted: Thu Jun 02, 2011 11:49 am    Post subject: Re: Values not writing into o/p file properly
Reply with quote

Vidya Kajale wrote:
[...]
The value of field RPT3-REC-TYPE is not coming properly in o/p file. It is truncating 1st byte in some case and in some case it printing correctly.
[...]


1) Is it a space?
2) Is it all the 02's?
3) Is it just the first 02?
4) Is there one of the many 02's in your program (horrible) that isn't actually an 02 but has that value?
5) Are you running with SSRANGE on?
[/quote]
Back to top
View user's profile Send private message
nigelosberry

New User


Joined: 06 Jan 2009
Posts: 88
Location: Ggn, IN

PostPosted: Thu Jun 02, 2011 11:50 am    Post subject: Re: Values not writing into o/p file properly
Reply with quote

Is it possible for you to paste:

(1) record area as defined in working storage(and the variable(s) defined before it).
(2) code for output field population and writing.

Without seeing the full code one can only guess about the possible problem.
Back to top
View user's profile Send private message
Vidya Kajale

New User


Joined: 01 Jun 2010
Posts: 43
Location: India

PostPosted: Thu Jun 02, 2011 11:59 am    Post subject: Values not writing into o/p file properly
Reply with quote

1. yes first byte it writing as spaces.

2. No all are not 02. It depends on record type. i need to print record type in 1st two byte. Insome cases it is 01, 02, 03, 4A, 4B, 4C,4D, 05,06 and so on.

3. And record tpe i am hard coding into program as 02, 03 and so on.

4. SSRANGE is not used.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Thu Jun 02, 2011 12:11 pm    Post subject: Reply to: Values not writing into o/p file properly
Reply with quote

fro what reason You are posting an attachment in windoze format, containing a screen shot,
wasting 70KB
when a plain cut an paste in text format surrounded by the code tags will take 160 bytes and carry the same info
like this
Code:
0  Settings      Terminal and user parameters            User ID . : ENRICO
1  View          Display source data or listings         Time. . . : 08:40

will carry the same info in a way much more understandable

furthermore not everybody can download attachments, limiting the number of people willing to help

the attachment has been deleted

just a hint,
did You consider that for a print <file/dataset> the first char usually contains the printer control char ( DSORG=FBA/VBA ) ???
Back to top
View user's profile Send private message
Vidya Kajale

New User


Joined: 01 Jun 2010
Posts: 43
Location: India

PostPosted: Thu Jun 02, 2011 12:30 pm    Post subject: Values not writing into o/p file properly
Reply with quote

Hi,

For our o/p file the DSORG is FBA.

When i try to print for record type 03 it printing correctly as 03 but for record type 02 it printing as 2.

So What shall i do?

I tried to cut & paste the o/p file but it was coming in tesx format black and white. How do we cut and paste in mainframe screen layout as u deed in above form.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Thu Jun 02, 2011 12:40 pm    Post subject: Reply to: Values not writing into o/p file properly
Reply with quote

click the [ Code ] box
paste the lines
click the [ Code ] box again

in the message box You use to type You will see something like
[???code???]the text to be bbcoded [???/code???]

the ??? are placeholders to show,not to do

to see that You do things right use the preview button !
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Thu Jun 02, 2011 12:43 pm    Post subject:
Reply with quote

Hi,

how are you viewing the output ? browse or edit ?


Gerry
Back to top
View user's profile Send private message
Vidya Kajale

New User


Joined: 01 Jun 2010
Posts: 43
Location: India

PostPosted: Thu Jun 02, 2011 12:47 pm    Post subject: Values not writing into o/p file properly
Reply with quote

In edit mode for record type 03 it is showing as 03 and for record type 02 it is showing as 2.

Whereas in browse mode for 03 it is showing as 3 and for 02 it showing 2.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Thu Jun 02, 2011 12:57 pm    Post subject:
Reply with quote

Hi,

in edit, what column is the 2 in ? 1 or 2 ?


Gerry
Back to top
View user's profile Send private message
Vidya Kajale

New User


Joined: 01 Jun 2010
Posts: 43
Location: India

PostPosted: Thu Jun 02, 2011 1:04 pm    Post subject:
Reply with quote

Hi,

in edit 2 is at 2nd column.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Thu Jun 02, 2011 1:13 pm    Post subject:
Reply with quote

Hi,

you better provide the information Nigel has requested.


Gerry
Back to top
View user's profile Send private message
nigelosberry

New User


Joined: 06 Jan 2009
Posts: 88
Location: Ggn, IN

PostPosted: Thu Jun 02, 2011 1:25 pm    Post subject: Re: Values not writing into o/p file properly
Reply with quote

For those who joined late, this is what the dataset in teh screenshot supplied by TS had:

Code:
 2;04-30-11;72000 ;1;2 AGAR ST.                                  ;NY;43328;OTHER
03;04-30-11;72000 ;1;2 AGAR ST.                                  ;NY;43328;SPRINT


I have manually typed in the two records(column 1 to 72). Apologies if there's any typo error.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7226

PostPosted: Thu Jun 02, 2011 1:47 pm    Post subject:
Reply with quote

Quote:

For our o/p file the DSORG is FBA.


Good spot enrico.

Concentrate on this Vidya. Why are you defining your output file with print file DSORG? Change it to FB. Have a look at the output.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7226

PostPosted: Thu Jun 02, 2011 1:50 pm    Post subject: Reply to: Values not writing into o/p file properly
Reply with quote

You want your report to look like that? OK, you have a report, then you have to have carriage control characters. How do they work? Look in the manual.
Back to top
View user's profile Send private message
Vidya Kajale

New User


Joined: 01 Jun 2010
Posts: 43
Location: India

PostPosted: Thu Jun 02, 2011 2:00 pm    Post subject: Values not writing into o/p file properly
Reply with quote

Hi ,

i have given DCB parameters as: DCB=(RECFM=FB,LRECL=300,BLKSIZE=3000)
Record format is FB and i have not mentioned DSORG anywhere.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7226

PostPosted: Thu Jun 02, 2011 2:03 pm    Post subject: Re: Values not writing into o/p file properly
Reply with quote

Vidya Kajale wrote:
Hi,

For our o/p file the DSORG is FBA.

When i try to print for record type 03 it printing correctly as 03 but for record type 02 it printing as 2.

So What shall i do?

I tried to cut & paste the o/p file but it was coming in tesx format black and white. How do we cut and paste in mainframe screen layout as u deed in above form.


Seems you did.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7226

PostPosted: Thu Jun 02, 2011 2:22 pm    Post subject:
Reply with quote

So, no RECFM=FBA.

Blanks and zeros are ANSI print control characters associated with FBA.

When you say "When i try to print" what do you mean? Are you browsing your actual file, or a print that you have done somehow of your actual file?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Thu Jun 02, 2011 2:45 pm    Post subject:
Reply with quote

What does the SELECT statement look like for this file?

What does the WRITE statement look like for this file?

Your basic issue is that something in COBOL is changing your file from FB to FBA, so you need to find out what is doing it. The most likely culprits are your SELECT statement or the WRITE statement.
Back to top
View user's profile Send private message
Vidya Kajale

New User


Joined: 01 Jun 2010
Posts: 43
Location: India

PostPosted: Thu Jun 02, 2011 2:55 pm    Post subject:
Reply with quote

Select statement is as:
SELECT PRINTER-TAPE-OT-T ASSIGN TO UT-S-WC280TT



And print statement is:

WRITE PRINT-LINE-T FROM WS-PRINT-LINE-T
AFTER ADVANCING 1 LINES,
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, 3  Next
Page 1 of 3

 

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