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

Question on output layout


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

New User


Joined: 01 Sep 2005
Posts: 10
Location: Bangalore

PostPosted: Fri Apr 14, 2006 6:38 pm
Reply with quote

Hi

I have one input file which is like this


ACC NO NAME SAL
-100 AAAA 2000
-200 BBBB 5000
-300 CCCC 3000

OutpuT layout

ACC NO NAME SAL

100 AAAA 2000
200 BBBB 5000
300 CCCC 300

I don't want - in output layout
]how can i do this
Back to top
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Fri Apr 14, 2006 7:21 pm
Reply with quote

yadagiri.p,

Your input filecopybook is probably something like:

Code:

    05  ACC-NO       PIC S9(3).
    05  NAME         PIC X(5).
    05  SAL          PIC 9(5).


Change the output to:

Code:

    05  ACC-NO       PIC 9(3).
    05  NAME         PIC X(5).
    05  SAL          PIC 9(5).


(remove the sign from ACC-NO)

Dave
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sat Apr 15, 2006 7:14 am
Reply with quote

But remember, you can't do a group move (i.e. input to output). You have to move the ACC-NO separately to realize the sign conversion.
Back to top
View user's profile Send private message
dneufarth

Active User


Joined: 27 Apr 2005
Posts: 420
Location: Inside the SPEW (Southwest Ohio, USA)

PostPosted: Sat Apr 15, 2006 9:57 pm
Reply with quote

just a thought

perhaps it's not a sign, but the ANSI triple space carriage control character.

SORT copy OUTREC can be used to strip it if not needed.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sat Apr 15, 2006 11:29 pm
Reply with quote

Just another thought,

I noticed that the sign is shown as leading. Is it separate? If so, you can use something like this:
Code:
 FD IP-FILE.
01  IP-REC.
    05  IR-SIGN    PIC  X(001).
    05  IR-DATA    PIC  X(013).

FD OP-FILE.
01  OP-REC         PIC  X(013).


READ IP-FILE
WRITE OP-REC FROM IP-DATA
This poses an interesting ques. Can you WRITE FROM a field that's not an 01 level. The manual seems to say "not". I've never tried it. Has anybody?

If not, you'll have to do the move to OP-REC yourself.
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 TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts Joinkeys - 5 output files DFSORT/ICETOOL 7
No new posts Build a record in output file and rep... DFSORT/ICETOOL 11
No new posts XDC SDSF output to temp dataset CLIST & REXX 4
Search our Forums:

Back to Top