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

Variable block issue


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

New User


Joined: 07 Mar 2005
Posts: 3

PostPosted: Mon Dec 17, 2007 3:41 pm
Reply with quote

Input is Variable 936 bytes (Input was converted from FB to Variable). First 900 bytes of input is written to the output file which is VB. But I still see the last 36 bytes as spaces X'00' i.e from 901 to 936 bytes of output.

Can you let me know what is causing last 36 bytes to be written. For a specific reason I can not put the value in WSO-REC-SIZE and it is too complicated to explain here. Please help


DATA DIVISION.
FILE SECTION.

FD ORDER-IN
RECORDING MODE IS V
BLOCK CONTAINS 0 RECORDS
RECORD IS VARYING FROM 1 TO 32700 CHARACTERS
DEPENDING ON WSI-REC-SIZE.
01 ORDER-INPUT.
05 ORDER-INPUT-RECORD PIC X(900).
05 OIR-PROD-DESC PIC X(30).
05 OIR-PROD-CODE PIC X(6).

FD ORDER-OUT
LABEL RECORDS ARE STANDARD
RECORDING MODE IS V
RECORD IS VARYING FROM 1 TO 32700 CHARACTERS
DEPENDING ON WSO-REC-SIZE.

01 ORDER-OUTPUT-RECORD PIC X(32700).

WORKING-STORAGE SECTION.

02 WSI-REC-SIZE PIC 9(5) VALUE 32700.
02 WSO-REC-SIZE PIC 9(5) VALUE 32700.

PROCEDURE DIVISION USING PARM.

MOVE ORDER-INPUT-RECORD TO ORDER-OUTPUT-RECORD.
WRITE ORDER-OUTPUT-RECORD.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Mon Dec 17, 2007 3:51 pm
Reply with quote

MOVE ORDER-INPUT TO ORDER-OUTPUT-RECORD.
Back to top
View user's profile Send private message
yarravajhala_p

New User


Joined: 07 Mar 2005
Posts: 3

PostPosted: Mon Dec 17, 2007 4:02 pm
Reply with quote

I only want to move 900 bytes to output file and not the last 36 bytes. Though no data is being moved here, the last 36 bytes have X'00' in the output.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Mon Dec 17, 2007 4:25 pm
Reply with quote

How long do you want the output record to be and if longer than 900 bytes, what do you want in the extra bytes?
Back to top
View user's profile Send private message
yarravajhala_p

New User


Joined: 07 Mar 2005
Posts: 3

PostPosted: Mon Dec 17, 2007 4:38 pm
Reply with quote

The want the output record length to be 900 but do not want to explicitly set that using WSO-REC-SIZE. I do not want X'00' to appear in 901-936 bytes. These bytes should appear just like other bytes, i.e 936-32700.

I tried declaring a seperate 01 level working storage variable, and tried moving ORDER-INPUT-RECORD to it and them from that variable to ORDER-OUTPUT-RECORD. But still no luck :-(
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Mon Dec 17, 2007 4:58 pm
Reply with quote

yarravajhala_p wrote:
The want the output record length to be 900 but do not want to explicitly set that using WSO-REC-SIZE.
The coding makes the output recl 32700, why do you want this?
Quote:
I do not want X'00' to appear in 901-936 bytes. These bytes should appear just like other bytes, i.e 936-32700.
You can always prefill the output record with whatever you want.
Quote:
I tried declaring a seperate 01 level working storage variable, and tried moving ORDER-INPUT-RECORD to it and them from that variable to ORDER-OUTPUT-RECORD.
That is just the same as your original code but with an extra move.
Quote:
But still no luck :-(
If you want 900 bytes out, move 900 to WSO-REC-SIZE.
Quote:
For a specific reason I can not put the value in WSO-REC-SIZE and it is too complicated to explain here.
Dumb....
If you don't want low values, move spaces and then just the 900 bytes, heck, just moving the 900 byte data area will pad the rest of the 32700 bytes with spaces....
Heck, I don't even see how you are getting the low values into the extra 36 bytes, unless you are moving them to the input record.....
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Tue Dec 18, 2007 3:12 am
Reply with quote

Add a 900 byte 01 rec descr to your ORDER-OUT FD then MOVE ORDER-INPUT TO rec descr and WRITE rec descr.

You might have to take out the DEPENDING, but you're not using it anyway.
Back to top
View user's profile Send private message
rz061m

New User


Joined: 03 Mar 2006
Posts: 48
Location: Chennai

PostPosted: Tue Dec 18, 2007 1:30 pm
Reply with quote

Hi,

Before moving to ORDER-OUTPUT-RECORD field; Initialize it and then try to move values to the field.

Thanks,
rz061m
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 Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Variable Output file name DFSORT/ICETOOL 8
No new posts Issue after ISPF copy to Linklist Lib... TSO/ISPF 1
No new posts Moving Or setting POINTER to another ... COBOL Programming 2
Search our Forums:

Back to Top