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

I need help with reading a variable length record with variable length fields.  These PESKY Z/OS Endevor SMF records also are not delimited.  We tried to use informat but realized that it is not supported by SAS v9.1.  No matter how we define the input we continue to get error messages and unexpected results.  If we can get past this one issue, we think we’re golden.

We know the location of the dataset length field in all the recs and the location of the dataset.  The length field for the dataset field is a 2-byte hex number, and we continue to get the message " Invalid data for DSLEN in line 1 305-306. "  Here’s a snippet of the input statement:

INPUT @3   TIMEDATE ?? SMFSTAMP8.         

      @31  USERID   $CHAR8.               

      @53  ACTION   $CHAR8.               

      @77  CCID     $CHAR12.              

      @201 ENVIR1   $CHAR8.               

      @209 STAG1    $CHAR8.               

      @217 SYST1    $CHAR8.               

      @225 SUBSYS1  $CHAR8.               

      @233 TYPE1    $CHAR8.               

      @305 DSLEN     HEX2.                

      @307 DATASET  $CHAR40.              

Record snip beginning at position 301:

12345678910 1112 1314 15 161718192021
301 ......APP.SG06201.ASM
ZONE 000000CDD4ECFFFFF4CED
NUMR00000F177B2706201B124

Thank you in advance for any help that you can provide.

1 ACCEPTED SOLUTION

Accepted Solutions
data_null__
Jade | Level 19

Try reading @305 dslen pib2.

then at @307  dataset $varying44. dslen

Untested just guessing.

View solution in original post

3 REPLIES 3
data_null__
Jade | Level 19

Try reading @305 dslen pib2.

then at @307  dataset $varying44. dslen

Untested just guessing.

jasullivan
Calcite | Level 5

The pib2 worked.  Previously when I tried the pd2, it still would not read the correct value.  Thank you both so much for your quick response!  Smiley Happy

garybald
Calcite | Level 5

For z/os try reading

@305 dslen pd2.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 928 views
  • 0 likes
  • 3 in conversation