I just started with Aspect, I have a situation where I create a list, send that list to a device, capture the device, and then sort the data for a specific sequence. I have figured out everything but the sort. Here is an example of the proc/file:
proc main
string FName ; Name of file to read.
string LineInfo ; Line from file.
string CName = "file.cap"
set capture file CName
clear
capture on
if sdlginput "File Name" "Name:" FName
if isfile FName ; Make sure file exists.
if fopen 0 FName READ ; Open file for read.
while not feof 0 ; Loop to end of file.
fgets 0 LineInfo ; Get line from file.
transmit "RTRV-T1::"
transmit LineInfo
transmit ":BW;^M"
endwhile
fclose 0 ; Close the file.
endif
else
errormsg "File doesn't exist."
endif
endif
pause 10 ;pause for terminal completion
capture off ;end capture
endproc
file.cap --
RTRV-T1::0840-14:BW;
5500 05-04-30 00:38:34
M BW COMPLD
"0840-14GRMAID=PM1D-0839-13,TACC=0,IDLECDE=AIS,OOSCDE=AIS,LINECDE=B8ZS,FMT=ESF,EQLZ=1,GOS=99,ALM=INH,ALMPF=99,FENDPMTYPE=ANSI
403,DS1ADDR=C,CSUADDR=B,TMG=THRU,FLTRC=NONE,PASUSP=OFF,SSM=NA,SSMDS1MODE=OFF,SSMUSER=SYS,PARTNAME=UASPARTST=IS-NR"
;
--------------------------
What I need to know is how do delete the RTRV line and the blank lines? Everything within the " " is a record. I need to query if the 840-14 record has LINECDE=B8ZS, if not, I need it to flag that record? Any ideas - knob?
proc main
string FName ; Name of file to read.
string LineInfo ; Line from file.
string CName = "file.cap"
set capture file CName
clear
capture on
if sdlginput "File Name" "Name:" FName
if isfile FName ; Make sure file exists.
if fopen 0 FName READ ; Open file for read.
while not feof 0 ; Loop to end of file.
fgets 0 LineInfo ; Get line from file.
transmit "RTRV-T1::"
transmit LineInfo
transmit ":BW;^M"
endwhile
fclose 0 ; Close the file.
endif
else
errormsg "File doesn't exist."
endif
endif
pause 10 ;pause for terminal completion
capture off ;end capture
endproc
file.cap --
RTRV-T1::0840-14:BW;
5500 05-04-30 00:38:34
M BW COMPLD
"0840-14GRMAID=PM1D-0839-13,TACC=0,IDLECDE=AIS,OOSCDE=AIS,LINECDE=B8ZS,FMT=ESF,EQLZ=1,GOS=99,ALM=INH,ALMPF=99,FENDPMTYPE=ANSI
403,DS1ADDR=C,CSUADDR=B,TMG=THRU,FLTRC=NONE,PASUSP=OFF,SSM=NA,SSMDS1MODE=OFF,SSMUSER=SYS,PARTNAME=UASPARTST=IS-NR"
;
--------------------------
What I need to know is how do delete the RTRV line and the blank lines? Everything within the " " is a record. I need to query if the 840-14 record has LINECDE=B8ZS, if not, I need it to flag that record? Any ideas - knob?