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
 

 

Variable block issue

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Variable block issue
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: 2150
Location: At my coffee table

PostPosted: Mon Dec 17, 2007 3:51 pm    Post subject:
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    Post subject: Reply to: Variable block issue
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: 2150
Location: At my coffee table

PostPosted: Mon Dec 17, 2007 4:25 pm    Post subject:
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    Post subject: Reply to: Variable block issue
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: 2150
Location: At my coffee table

PostPosted: Mon Dec 17, 2007 4:58 pm    Post subject: Re: Reply to: Variable block issue
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    Post subject:
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    Post subject:
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    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 Can I traverse a STEM variable? chong.zhou CLIST & REXX 5 Wed May 31, 2017 3:54 pm
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am
No new posts Writing on to GSAM variable length rohanthengal JCL & VSAM 6 Fri Mar 03, 2017 7:46 pm


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