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 

Data type conversion in Easytrieve

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


Joined: 08 Dec 2006
Posts: 14
Topics: 8

PostPosted: Tue Mar 13, 2007 5:44 am    Post subject: Data type conversion in Easytrieve Reply with quote

hi,

i need to convert a data which is of binary and packed decimal type into numeric type in easytrieve.Please let me know the ways.

thanks
Saraswathi
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Tue Mar 13, 2007 6:17 am    Post subject: Reply with quote

saraswathi,

Move them numeric defined variable
Code:

ws-readable-num   w 10 N 0


Move your packed and binary values to that variable and it will convert them to readable format.

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


Joined: 08 Dec 2006
Posts: 14
Topics: 8

PostPosted: Tue Mar 13, 2007 7:11 am    Post subject: Reply with quote

hi,
thanks for your response.but still i am facing a problem.
i have given my code below.
Code:

FILE  INFILE
   M-DUNS           01  4  B
   M-CCSPCTL        13  2  P
*
*
FILE OUTFILE
   O-DUNS           01  9  N                 
   O-CCSPCTL        11  3  N                 
*
   W-DUNS           W   9  N                                   
   W-CCSPCTL        W   3  N                                   
*
JOB INPUT (INFILE)                                               
        IF EOF INFILE                                             
           STOP                                                   
        END-IF                                                   
        MOVE INFILE:M-DUNS TO W-DUNS                             
        MOVE INFILE:M-CCSPCTL TO W-CCSPCTL                       
        MOVE W-DUNS TO OUTFILE:O-DUNS                             
        MOVE W-CCSPCTL TO OUTFILE:O-CCSPCTL                       
        PUT OUTFILE                                               
        DISPLAY 'VALUES ' W-DUNS   W-CCSPCTL 

The code throws A006 PROGRAM INTERRUPT - CODE 7 (DATA EXCP) error.please clarify this

Thanks,
Saraswathi
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Tue Mar 13, 2007 9:08 am    Post subject: Reply with quote

saraswathi,

Do not use MOVE statements. You also do not need to check for EOF condition. Easytrieve automatically takes care of EOF when you are using Syncronised file processing. You only need to check for EOF when you are using GET statement.

Your pgm is as simple as this. Mind you will only get positive values since you did not consider the Sign on the output fields definition.

Code:

 FILE INFILE                                 
    M-DUNS           01  4  B               
    M-CCSPCTL        13  2  P               
                                             
 FILE OUTFILE                               
    O-DUNS           01  9  N               
    O-CCSPCTL        11  3  N               
                                             
 JOB INPUT INFILE                           
                                             
    O-DUNS     = M-DUNS                       
    O-CCSPCTL  = M-CCSPCTL                   
    PUT OUTFILE                             
    DISPLAY 'VALUES ' O-DUNS ' ' O-CCSPCTL   


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
saraswathi
Beginner


Joined: 08 Dec 2006
Posts: 14
Topics: 8

PostPosted: Tue Mar 13, 2007 11:13 pm    Post subject: Data type conversion in Easytrieve Reply with quote

thank you very much.it works fine.
Back to top
View user's profile Send private message
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