BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Lloyd_C
Fluorite | Level 6

SAS V9.4.

I'm stumped. I have a small file containing error messages from an IBM z/OS utility. I am reading a file that is the SYSPRINT messages from an IDCAMS DCOLLECT run. I have multiple types of records, and delete what I consider trash - for example, the first line.

 

The records I want all begin with 'IDC11808I' but the record is spread across two lines. One field on the first line is a dataset name(Bad_VVR_DSN) and can be up to 44 characters long. After each dataset name is ' ON ' followed by a 6-character volser.  I read the dataset name (Bad_VVR_DSN) and use an '@' to hold the record. I then do on_ix = index(Full_Rec,' ON ');  I then have VOL_START = on_ix + 4.  Followed by INPUT @(VOL_START) volser $char6.; 

 

But I'm not getting the value for volser off most of the records. I also only see half my records (that is, I know there are 8 problems and only see 4 of them).

For example, in the file Lloyd_C_DCOLLECT_SYSPRINT.txt there is a pair of records for Bad_VVR_DSN = LLOYD.CWC.GLOBAL.CSI.BKUP.DATA and it shows in the SASPRINT. There is also a pair of lines for LLOYDC.CWC.GLOBAL.CSI.BKUP.INDEX but that is not in the output.

The SAS code is in Lloyd_C_DCOLLECT_BADVVR.txt.  I output the full record in the SASLOG.

 

Why is the INPUT @VOL_START not resulting in a value for most of the records? Why am I only seeing half of my input records?

 

1 ACCEPTED SOLUTION

Accepted Solutions
Lloyd_C
Fluorite | Level 6

Found a way to make it work. Might not be the best solution but after the concatenation of the two-line record I save it. Then another data step parsed it using scan. I have all 8 observations, not just 4 observations, and the variables I was after all have valid data.    

So, works even if pretty ugly

View solution in original post

4 REPLIES 4
Lloyd_C
Fluorite | Level 6

Found a way to make it work. Might not be the best solution but after the concatenation of the two-line record I save it. Then another data step parsed it using scan. I have all 8 observations, not just 4 observations, and the variables I was after all have valid data.    

So, works even if pretty ugly

Tom
Super User Tom
Super User

I don't understand what your input is as the phrase "an IDCAMS DCOLLECT run" does not mean anything to me.  The text files you attached both appear to be SAS listing outputs.  Are you trying to write a data step to read back in a SAS listing output file?  If not then please share the an example INPUT file.

Lloyd_C
Fluorite | Level 6

Hello, 

On the IBM mainframe, within the z/OS operating system there is a very important utility called IDCAMS. A function in IDCAMS is DCOLLECT which gathers information about all of the files on the disk subsystems and a lot of information about files that have been archived to compressed disk or to tape. The input to my program is the log, including error data encountered, as the utility scans the disk subsystems. I believe I included that with my original post. 

 

I have found a work-around to my problem. There's probably a more elegant way to do it, but it works. This can be closed.

CFC_SAS_Communities_400x225.jpg

Call for content now open!

It's your turn to help shape SAS Innovate 2027. Share your expertise and inspire the SAS community.

Submit your proposal →

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
  • 4 replies
  • 221 views
  • 0 likes
  • 2 in conversation