[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: [sqr-users] Read Flat file



Radhika,
        If the First row is Always a header then You can Put 2 Read
Statements else you can check and Ignore the first line. 

let $bFlag = 'y' 

read 1 into $record 
if #end-file 
   let $bFlag = 'n' 
end-if 

while bFlag = 'y' 
    read 1 into $record 
   
    if #end-file 
        break 
    end-if 

    ! do Processing here. 

end-while 

--- radhika reddy <radhika_05@hotmail.com> wrote:

> Hi,
> 
>    I have a requirement where i have to read a flat file in SQR. The
> flat 
> file has heading and then the data. earlier i wrote some sqr's where
> i read 
> the data without heading like the following:-
> but now i want to process the data without heading. Any ideas?
> 
> let $file = {FILEPREFIX}emplben.txt
> OPEN $file  AS 10
> FOR-READING
> RECORD=301:VARY
> STATUS = #OPEN1
> 
> IF #OPEN1 =-1
>    SHOW 'ERROR OPENING INPUT FILE:'
>    let #prcs_run_status = #prcs_run_status_unsuccessful
>    let $prcs_message_parm1 = 'Unsuccessful Completion'
>    do Update-Prcs-Run-Status
> 
>    STOP
> END-IF
> 
> 
> For example:-
> 
> SSNO                  Name
> 4453333333       Paul
> 3443434343       kim
> 
> Here i just want to process the data.
> 
> Thanks.
> 
> _________________________________________________________________
> Express yourself instantly with MSN Messenger! Download today - it's
> FREE! 
> http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
> 
> 
> _______________________________________________
> sqr-users mailing list
> sqr-users@sqrug.org
> http://www.sqrug.org/mailman/listinfo/sqr-users
> 



                
__________________________________ 
Do you Yahoo!? 
All your favorites on one personal page – Try My Yahoo!
http://my.yahoo.com 

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users