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 

Problem in SAS

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


Joined: 12 Sep 2003
Posts: 3
Topics: 2

PostPosted: Thu Sep 30, 2004 10:41 pm    Post subject: Problem in SAS Reply with quote

Hi,
I need to convert a comma delimited file to a fixed length one. The total length of the Fixed length file is 356 bytes.

Please find the SAS controlcard which I am using as follows:
Code:

DATA FILE1;                                     
     INFILE FILE1 DLM=',' DSD ;                 
     INPUT  RECORD_TYPE                 : $02.   
            NSIN                        : $12.   
            EXCHANGE_CODE               : $05.   
            SECURITY_TYPE               : $02.   
            SECURTIY_SUBTYPE            : $01.   
            PRICE_CURRENCY_CODE         : $03.   
            CALCULATION_METHOD_CODE     : $02.   
            NOMINAL_CURRENCY_CODE       : $03.   
            NOMINAL_VALUE               : $14.   
            NON_PAID_UP_AMOUNT          : $14.   
            BID_PRICE                   : $14.   
            BID_PRICE_DATE              : $08.   
            BID_PRICE_TIME              : $04.   
            ASK_PRICE                   : $14.   
            ASK_PRICE_DATE              : $08.   
            ASK_PRICE_TIME              : $04.   
            TRADING_VOLUME              : $14.   
            TRADING_VOLUME_DATE         : $08.   
            OPEN_PRICE                  : $14.   
            OPEN_PRICE_TIME             : $04.   
            HIGH_PRICE                  : $14.   
            HIGH_PRICE_TIME             : $04.   
            LOW_PRICE                   : $14.   
            LOW_PRICE_TIME              : $04.   
            LAST_PRICE_VALUE_STYLE      : $03.   
            LAST_PRICE                  : $14.   
            TRADING_DATE                : $08.   
            TRADING_TIME                : $04.   
            PREVIOUS_LAST_PRICE         : $14.   
            PREVIOUS_LAST_PRICE_DATE    : $08.   
            SPECIAL_PRICE_VALUE_TYPE    : $03.   
            SPECIAL_PRICE_VALUE_STYLE   : $03.   
            SPECIAL_PRICE               : $14.   
            SPECIAL_PRICE_DATE          : $08.   
            SPECIAL_PRICE_TIME          : $04.   
            VALUATION_PRICE_VALUE_TYPE  : $03.
            VALUATION_PRICE_VALUE_STYLE : $03.
            VALUATION_PRICE             : $14.
            VALUATION_PRICE_DATE        : $08.
            LISTING_EVENT_CODE          : $03.
            EX_CODE                     : $03.
            EX_CODE_DATE                : $08.
            SECURITY_SHORT_NAME         : $19.
            TRADING_SYMBOL              : $15.
            RESERVED_ERR_CODE           : $02.
            RESERVED                    : $09.
     ;                                       
DATA FSUMK;                                   
   SET FILE1;                                 
   FILE FMERGE;                               
      PUT @1 RECORD_TYPE                     
          @3 NSIN                             
         @15 EXCHANGE_CODE                   
         @20 SECURITY_TYPE                   
         @22 SECURTIY_SUBTYPE           
         @23 PRICE_CURRENCY_CODE       
         @26 CALCULATION_METHOD_CODE   
         @28 NOMINAL_CURRENCY_CODE     
         @31 NOMINAL_VALUE             
         @45 NON_PAID_UP_AMOUNT         
         @59 BID_PRICE                 
         @73 BID_PRICE_DATE             
         @81 BID_PRICE_TIME             
         @85 ASK_PRICE                 
         @99 ASK_PRICE_DATE             
        @107 ASK_PRICE_TIME             
        @111 TRADING_VOLUME             
        @125 TRADING_VOLUME_DATE       
        @133 OPEN_PRICE                 
        @147 OPEN_PRICE_TIME           
        @151 HIGH_PRICE                 
        @165 HIGH_PRICE_TIME           
        @169 LOW_PRICE                 
        @183 LOW_PRICE_TIME                 
        @187 LAST_PRICE_VALUE_STYLE         
        @190 LAST_PRICE                     
        @204 TRADING_DATE                   
        @212 TRADING_TIME                   
        @216 PREVIOUS_LAST_PRICE           
        @230 PREVIOUS_LAST_PRICE_DATE       
        @238 SPECIAL_PRICE_VALUE_TYPE       
        @241 SPECIAL_PRICE_VALUE_STYLE     
        @244 SPECIAL_PRICE                 
        @258 SPECIAL_PRICE_DATE             
        @266 SPECIAL_PRICE_TIME             
        @270 VALUATION_PRICE_VALUE_TYPE     
        @273 VALUATION_PRICE_VALUE_STYLE   
        @276 VALUATION_PRICE               
        @290 VALUATION_PRICE_DATE           
        @298 LISTING_EVENT_CODE             
        @301 EX_CODE                       
        @304 EX_CODE_DATE                   
        @312 SECURITY_SHORT_NAME   
        @331 TRADING_SYMBOL       
        @346 RESERVED_ERR_CODE     
        @348 RESERVED             
      ;                           

FILE1 is the input comma delimited file and FMERGE is output fixed layout file. When I run the Jcl using this SAS controlcard, I find that very few of the input records(in comma delimited file) are missing in the Output(Fixed layout file).. Since I am not well versed in SAS, I am not able to find the reason for this... Sad
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


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

PostPosted: Fri Oct 01, 2004 4:48 am    Post subject: Reply with quote

padma,

If a record does not contain enough bytes to satisfy the INPUT statement, Then SAS will read the next record. You will find notes in the log that tell a user this action occurred: LOST CARD

If that is the problem then add the TRUNCOVER or MISSOVER option to the INFILE statement.

TRUNCOVER- By default, if SAS reads past the end of a record and has not satisfied the INPUT statement, it continues to read data from the next record. This action is called FLOWOVER. MISSOVER is an option that overrides the default action of FLOWOVER, and causes a variable to be set to missing if the INPUT statement is unable to read the entire value. TRUNCOVER is similar to MISSOVER, since it also overrides the default action of FLOWOVER. However, instead of setting a variable
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
padma
Beginner


Joined: 12 Sep 2003
Posts: 3
Topics: 2

PostPosted: Fri Oct 01, 2004 2:29 pm    Post subject: Reply with quote

Thanks a lot Smile
Now I've changed the infile parameter as
INFILE FILE1 TRUNCOVER DSD ;
And it seems to work

We have our implementation next week and you've helped me immensely.

Thanks again
Back to top
View user's profile Send private message Send e-mail
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