Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
DATA Convertion in batch process

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
pa3lo

New User


Joined: 26 Mar 2007
Posts: 9
Location: Argentina

PostPosted: Thu Dec 13, 2007 7:11 pm    Post subject: DATA Convertion in batch process
Reply with quote

I have the following INPUT FILE for a batch process:

99040100 0120 300511999022619990226
99040100 0120 -126211999022619990226
99040100 0120 104581999030919990309
99040100 7100 128981999030919990309

I read it with this copy:

FD UNLD.
01 REG-UNLD.
03 UNLD-X1 PIC X(08).
03 UNLD-X2 PIC X(02).
03 UNLD-X3 PIC 9(04).
03 UNLD-X4 PIC S9(19).
03 UNLD-X5 PIC X(08).
03 UNLD-X6 PIC X(08).

and write it in another file with this format:

FD OUTFILE.
01 OUTFILE.
03 OUT-X1 PIC X(08).
03 OUT-X2 PIC X(02).
03 OUT-X3 PIC 9(04).
03 OUT-X4 PIC S9(9)V99.
03 OUT-X5 PIC X(08).
03 OUT-X6 PIC X(08).

99040100 0120000030051001999022619990226
99040100 0120000=12621001999022619990226
99040100 0120000010458001999030919990309
99040100 7100000012898001999030919990309

with the '-' replaced by a '='. Could someone tell me why this happening? I want the "000=1262100" to be an "0000001262q", how can i do this?
Back to top
View user's profile Send private message

Gnanas N

Active Member


Joined: 06 Sep 2007
Posts: 788
Location: Chennai, India

PostPosted: Thu Dec 13, 2007 8:02 pm    Post subject:
Reply with quote

Here, You are moving S9(19) to S9(9)V99. Is it okay?

Correct me if I am wrong.
Back to top
View user's profile Send private message
pa3lo

New User


Joined: 26 Mar 2007
Posts: 9
Location: Argentina

PostPosted: Thu Dec 13, 2007 8:13 pm    Post subject:
Reply with quote

Yes, i'm actually doing that in my program, is it wrong to do it? what could be the problem with it?.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Thu Dec 13, 2007 8:54 pm    Post subject:
Reply with quote

pa3lo wrote:
Yes, i'm actually doing that in my program, is it wrong to do it? what could be the problem with it?.


If you can't fiqure it out I am not going to bother explaining it.
Back to top
View user's profile Send private message
pa3lo

New User


Joined: 26 Mar 2007
Posts: 9
Location: Argentina

PostPosted: Thu Dec 13, 2007 9:17 pm    Post subject:
Reply with quote

Craq Giegerich wrote:
If you can't fiqure it out I am not going to bother explaining it.


Don't bother then, its been solved already, thank you.
Back to top
View user's profile Send private message
Gnanas N

Active Member


Joined: 06 Sep 2007
Posts: 788
Location: Chennai, India

PostPosted: Thu Dec 13, 2007 9:31 pm    Post subject:
Reply with quote

It's fine. Could you please share how to sove this?
Back to top
View user's profile Send private message
socker_dad

Active User


Joined: 05 Dec 2006
Posts: 147
Location: Columbia, MO

PostPosted: Thu Dec 13, 2007 9:49 pm    Post subject: Reply to: DATA Convertion in batch process
Reply with quote

Fairly simple, actually. He stated:


Quote:
Yes, i'm actually doing that in my program, is it wrong to do it? what could be the problem with it?.



If you don't want to see it, don't do it. Duh.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Thu Dec 13, 2007 9:52 pm    Post subject:
Reply with quote

Try moving 123456789012345 to a pic 9(9)v99 field!
Back to top
View user's profile Send private message
socker_dad

Active User


Joined: 05 Dec 2006
Posts: 147
Location: Columbia, MO

PostPosted: Thu Dec 13, 2007 9:56 pm    Post subject: Reply to: DATA Convertion in batch process
Reply with quote

It truncates the high-order digits. According to Murach, the result "should" be 567890123.45
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Thu Dec 13, 2007 10:01 pm    Post subject: Re: Reply to: DATA Convertion in batch process
Reply with quote

socker_dad wrote:
It truncates the high-order digits. According to Murach, the result "should" be 567890123.45


Not according to any rules for cobol moves I have ever seen. Yes, it will truncate the high-order digits without any warning or error message that is the problem.
Back to top
View user's profile Send private message
pa3lo

New User


Joined: 26 Mar 2007
Posts: 9
Location: Argentina

PostPosted: Thu Dec 13, 2007 10:54 pm    Post subject:
Reply with quote

Modified the copy of the input file for this:

FD UNLD.
01 REG-UNLD.
03 UNLD-X1 PIC X(08).
03 UNLD-X2 PIC X(02).
03 UNLD-X3 PIC 9(04).
03 UNLD-SIGN PIC X.
03 UNLD-X4 PIC S9(18).

03 UNLD-X5 PIC X(08).
03 UNLD-X6 PIC X(08).

that way the sign will be storage in UNLD-SIGN, then i evaluate the value of it, if it's a '-' then i multiply UNLD-X4 BY -1 giving OUT-X4 the other way simply move the values.

Don't know if it's the best solution but it works.
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 Moving a COMP-3 Variable to a Numeric... ajayachander COBOL Programming 2 Thu Dec 14, 2017 5:46 pm
No new posts CA Intertest Batch 555shanth CA Products 0 Tue Nov 28, 2017 11:10 am
No new posts Extract record for change in combinat... Trinadh DFSORT/ICETOOL 6 Thu Nov 23, 2017 3:32 pm
No new posts How to query MAXGENS of an existing P... Chuchulo Hatyzak JCL & VSAM 4 Wed Nov 22, 2017 10:23 pm
No new posts Fetching data from JHS as per the cur... arunsoods All Other Mainframe Topics 4 Wed Nov 22, 2017 1:54 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us