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

Wanted to cpy the COMP3 data to COMP or cha format in Out f


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

New User


Joined: 11 Apr 2006
Posts: 41
Location: Chennai

PostPosted: Thu Feb 22, 2007 3:45 pm
Reply with quote

Hello,

I have one PS file in that those fields has COMP3 data. I would like to copy that file information into output PS file but I would like to see the data in character format in output PS file not in COMP-3 format. Could you please suggest me if is there any way to copy the data from input file to output file by changing the COMP3 data to COMP or character format.

Thanks&Regrads,
Suresh
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 771
Location: Germany

PostPosted: Thu Feb 22, 2007 3:55 pm
Reply with quote

Hi !

You could do the copy via the Sort-Utility. By using masks for the comp3-data you could transform them to numeric data you could read.

Suppose you have input records with numeric values stored in PD format that you want to display or print so they can be easily interpreted. PD values are stored as integers in a compressed internal format that is actually unreadable if you print or display the values.
However, you know that:
The first PD field represents a number with two decimal places.
The second PD field represents a number with three decimal places.
The third PD field represents a date in the form mmddyyyy.
You can use the edit features of the OUTREC statement to display the digits of the PD values as readable characters. Furthermore, you can use the edit features to insert signs, commas, decimal points and hyphens, as appropriate, to make the PD values easy to interpret.

You can use the following OUTREC statement to make the PD values meaningful:
OUTREC FIELDS=(1,8,
5X,
11,6,PD,M4,
5X,
31,7,PD,EDIT=(SI,III,III,IIT.TTT),SIGNS=(,-),
5X,
41,5,PD,EDIT=(TT-TT-TTTT))


M4 is one of DFSORT's 27 pre-defined edit masks. It edits a numeric field according to the pattern SI,III,III,III,IIT.TT. EDIT=(SI,III,III,IIT.TTT) is a user-defined edit mask. It edits a numeric field according to the pattern SI,III,III,IIT.TTT. EDIT=(TT-TT-TTTT) is another user-defined edit mask. It edits a numeric field according to the pattern TT-TT-TTTT.

For all pre-defined masks have a look at bookmanager / sort.

Regards, UmeySan
Back to top
View user's profile Send private message
sureshbabu.jv

New User


Joined: 11 Apr 2006
Posts: 41
Location: Chennai

PostPosted: Thu Feb 22, 2007 4:21 pm
Reply with quote

Thanks UmeySan!!

I will try with that file declaration :

Those fields declared like below in Input file, I would like to convert all those fileds into COMP or Char format in to output file.

10 MRSX-EQPT-LOC.
15 MRSX-EL-AREA PIC X(03).
15 MRSX-EL-ELEV PIC X(04).
15 MRSX-EL-COLM PIC X(05).
15 MRSX-EL-AZIM PIC X(03).
10 MRSX-COMP3-DATA COMPUTATIONAL-3.
15 MRSX-EST-MATL-STK PIC S9(09)V9(02).
15 MRSX-EST-MATL-NS PIC S9(09)V9(02).
15 MRSX-EST-LABOR-HR-ELSPD PIC S9(09)V9(02).
15 MRSX-EST-LABOR-HR-TOT PIC S9(09)V9(02).
15 MRSX-EST-LABOR-COST PIC S9(09)V9(02).
15 MRSX-EST-CONTRACT PIC S9(09)V9(02).
15 MRSX-EST-TECH-DIRECT PIC S9(09)V9(02).
15 MRSX-ACT-MATL-STK PIC S9(09)V9(02).
15 MRSX-ACT-MATL-NS PIC S9(09)V9(02).
15 MRSX-ACT-LABOR-COST PIC S9(09)V9(02).
15 MRSX-ACT-CONTRACT PIC S9(09)V9(02).
15 MRSX-ACT-TECH-DIRECT PIC S9(09)V9(02).

Thanks,
Suresh
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 How to save SYSLOG as text data via P... All Other Mainframe Topics 4
No new posts Store the data for fixed length COBOL Programming 1
No new posts Populate last day of the Month in MMD... SYNCSORT 2
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
Search our Forums:

Back to Top