MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Need a generic program that convert all COMP, COMP-3 fields

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
ha.rajamohamed
Beginner


Joined: 29 Jan 2006
Posts: 71
Topics: 22

PostPosted: Thu Aug 17, 2006 11:40 pm    Post subject: Need a generic program that convert all COMP, COMP-3 fields Reply with quote

Need a generic program that can read any file and given the copy book layout of the file , can convert all COMP, COMP-3 etc into a simple flat file with each field in normal display mode and pipe delimited.

The Program can be Cobol, SAS, REXX, File Aid or any thing else.

This is really helpful for me if this is done... thanks in advance

Note: I have also posted the same query under "Mainframe Challenges"
_________________
RAJA MOHAMED
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12370
Topics: 75
Location: San Jose

PostPosted: Fri Aug 18, 2006 5:53 am    Post subject: Reply with quote

Quote:

Note: I have also posted the same query under "Mainframe Challenges"

ha.rajamohamed,

Please follow the rules of posting in the forum. Do not post the same topic in more than 1 forum. Read the guidelines for posting in the mainframe challenges forum.

KOlusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
dz
Beginner


Joined: 02 Apr 2006
Posts: 26
Topics: 0

PostPosted: Fri Aug 18, 2006 8:41 am    Post subject: Reply with quote

You can do that in both SYSCSORT and DFSORT. For example, I have used the following SYNCSORT statement recently to format PIC S9(09)V9(09) COMP-3 price field into ZD format, and then to get rid of the sign:

Code:
INREC FIELDS=(01:017,09,                    ** CUSIP   - 09           
               10:1X,                                                 
               11:053,10,PD,ZD,LENGTH=18)    ** PRICE TO ZD           
                                                                       
SORT FIELDS=(1,9,CH,A)                       ** BY CUSIP               
SUM FIELDS=NONE                              ** ONLY ONE REC PER CUSIP
                                                                       
* FORMAT ( INTEGER . DECIMAL   , NO SIGN)                 
OUTREC FIELDS=(01:1,09,                   *CUSIP   - 09               
               10:1X,                                                 
               11:11,09,                  *INTEGER PART OF THE PRICE   
               20:C'.',                                               
               21:20,09,ZD,EDIT=(TTTTTTTTT),SIGNS=(,,,),  *DECIMAL PART
               30:51X)                                             
   
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12370
Topics: 75
Location: San Jose

PostPosted: Fri Aug 18, 2006 8:44 am    Post subject: Reply with quote

dz,

OP does not know the positions of the COMP/COMP-3 variables. He wants a generic program that can write out expanding the non displayable data when supplied with a file layout.

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
coolman
Intermediate


Joined: 03 Jan 2003
Posts: 283
Topics: 27
Location: US

PostPosted: Fri Aug 18, 2006 12:52 pm    Post subject: Reply with quote

Raja,

Can you post as to what have you accomplished so far on this? And we'll give you suggestions to make this better.
________
vaporizer


Last edited by coolman on Sat Feb 05, 2011 1:48 am; edited 1 time in total
Back to top
View user's profile Send private message
ha.rajamohamed
Beginner


Joined: 29 Jan 2006
Posts: 71
Topics: 22

PostPosted: Mon Aug 21, 2006 6:02 am    Post subject: Reply with quote

Coolman,
I have not much proceeded on this. Till now I have coded in COBOL using move CORR. But this is specific to a single file and layout.
I am having 50+ different files with different layouts, so i am in help of a generic program.
_________________
RAJA MOHAMED
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12370
Topics: 75
Location: San Jose

PostPosted: Mon Aug 21, 2006 10:25 am    Post subject: Reply with quote

ha.rajamohamed,

What is the max lrecl of the files involved? If the file lrecl is less than 100 then you can use VPRINT option from File-aid which will print all the records in a displayable format. Unfortunately the output file lrecl is only limited to 132 bytes.

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ha.rajamohamed
Beginner


Joined: 29 Jan 2006
Posts: 71
Topics: 22

PostPosted: Thu Aug 24, 2006 4:24 am    Post subject: Reply with quote

Kolusu,

I am off for couple of days so unable to reply you..

The LRECL are more than 132 bytes, varies between 1000 to 5000 bytes.
_________________
RAJA MOHAMED
Back to top
View user's profile Send private message
ha.rajamohamed
Beginner


Joined: 29 Jan 2006
Posts: 71
Topics: 22

PostPosted: Wed Aug 30, 2006 4:36 am    Post subject: Reply with quote

I heard there is a posibility through EasyDrive, but I have not worked on EasyDrive.

I browsed around FILEAID, I havn't got any results so far.

Is anyone come up this situations... and sloved it..

Thanks in advance.
_________________
RAJA MOHAMED
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12370
Topics: 75
Location: San Jose

PostPosted: Wed Aug 30, 2006 7:17 am    Post subject: Reply with quote

Quote:

I heard there is a posibility through EasyDrive, but I have not worked on EasyDrive.


ha.rajamohamed,

EasyDrive ? Did you mean Easytrieve? Easytrieve is capable of converting but you need to supply the output layout.

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group