BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
ralph_muro
Calcite | Level 5

I am trying to read a number of FIX TAGS but can not guarentee the order that the tags will be placed in a file and between different files.. Is there a way to use the @ pointer in a way where the tag of interest is not always in the same order reletive to the other tags? Should I consider a different method to get the data I need? Maybe substring?

data ccgINmsgs;
infile &ccgorderspath &ccgrecord &readlength;
input timein 19.
@'35=' inmsgtype :$1.
@'49=' sendercompid :$30.
@'52=' fixtimein :$21.
@'11=' clordid :$50.
@'55=' symbol :$7.;

humantimein = input(substr(fixtimein,10,8), time8.);
humanDATEin = input(substr(fixtimein,1,8), ANYDTDTE8.);
complete_timein = dhms(humanDATEin,0,0,humantimein);
format complete_timein datetime16.;
format humanDATEin DATE8.;
*ns_timein = input(substr(timein,10,9), 9.);
RUN;

sample data: this string breaks because tag 52 comes before 49. this is out of the expected order.
13739260586369179258=FIX.4.3 9=0156 35=D 52=20130715-22:07:38 34=48 49=XXXX-CCG-1 56=FXALL 1=XXXX_XXXX 54=1 11=69432400003 38=1000000 55=GBP/USD 44=1.5101900 40=2 60=20130715-22:07:38 64=SPOT 10=060

1 ACCEPTED SOLUTION

Accepted Solutions
data_null__
Jade | Level 19

Can you start the search from column 1 each time.

filename FT15F001 temp;
data ccgINmsgs;
infile FT15F001;
input timein 19.
@
1 @'35=' inmsgtype :$1.
@
1 @'49=' sendercompid :$30.
@
1 @'52=' fixtimein :$21.
@
1 @'11=' clordid :$50.
@
1 @'55=' symbol :$7.;

humantimein = input(substr(fixtimein,
10,8), time8.);
humanDATEin = input(substr(fixtimein,1,8), ANYDTDTE8.);
complete_timein = dhms(humanDATEin,
0,0,humantimein);
format complete_timein datetime16.;
format humanDATEin DATE8.;
*ns_timein = input(substr(timein,10,9), 9.);
parmcards;
13739260586369179258=FIX.4.3 9=0156 35=D 52=20130715-22:07:38 34=48 49=XXXX-CCG-1 56=FXALL 1=XXXX_XXXX 54=1 11=69432400003 38=1000000 55=GBP/USD 44=1.5101900 40=2 60=20130715-22:07:38 64=SPOT 10=060
;;;;

View solution in original post

2 REPLIES 2
data_null__
Jade | Level 19

Can you start the search from column 1 each time.

filename FT15F001 temp;
data ccgINmsgs;
infile FT15F001;
input timein 19.
@
1 @'35=' inmsgtype :$1.
@
1 @'49=' sendercompid :$30.
@
1 @'52=' fixtimein :$21.
@
1 @'11=' clordid :$50.
@
1 @'55=' symbol :$7.;

humantimein = input(substr(fixtimein,
10,8), time8.);
humanDATEin = input(substr(fixtimein,1,8), ANYDTDTE8.);
complete_timein = dhms(humanDATEin,
0,0,humantimein);
format complete_timein datetime16.;
format humanDATEin DATE8.;
*ns_timein = input(substr(timein,10,9), 9.);
parmcards;
13739260586369179258=FIX.4.3 9=0156 35=D 52=20130715-22:07:38 34=48 49=XXXX-CCG-1 56=FXALL 1=XXXX_XXXX 54=1 11=69432400003 38=1000000 55=GBP/USD 44=1.5101900 40=2 60=20130715-22:07:38 64=SPOT 10=060
;;;;
ralph_muro
Calcite | Level 5

That did it... its the little things that get me. Smiley Wink

sas-innovate-white.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 767 views
  • 0 likes
  • 2 in conversation