I have not done this is a long time with sas, I use to have mainframe examples on reading mainframe print line and search for a string like 'load module' then i know I need to get the next 45 characters which is dataset name and member and them amode and rmode information.
Thanks
Easy enough. Just use the trailing @ symbol on your INPUT statement to hold that data row for reading further. Just need to know where in the input record 'load module' is located:
input @1 string $11. @;
if string = 'load module' then input @12 string2 $45.;
Easy enough. Just use the trailing @ symbol on your INPUT statement to hold that data row for reading further. Just need to know where in the input record 'load module' is located:
input @1 string $11. @;
if string = 'load module' then input @12 string2 $45.;
Thanks it has been 10 years since I coded sas or MXG.
If the information may not be at the start of the string perhaps the input @?
The first input @ is just to read the line of data into the input buffer variable _infile_. Then the value can be searched for information such as with the INDEX function (>0 is just a check for "is present"). The Input @"load module" then finds the position of the text "load module" and starts reading afterward for the number of characters in the format following string (I used 15 as too lazy to type longer example text and datalines sometimes gets picky about length of lines)
data example; infile datalines truncover; input @; if index(_infile_,"load module")>0 then do; input @"load module" string $15.; end; else input; datalines; Some sort of text that might contain load module followed by something else other text not of particular interest or needs other read statement ;
Sorry for another question. it has been 10 years since i did SAS and MXG.
The report I am reading has information on 2 lines that I want to report on.
How do I do that with SAS, read 1 line get some info then read the next line they output what I had found.
Thanks
This is my input from Load Module analyzer
I want the dataset, then read till i get the cobol version, etc, else DROP
Load Module S24028.SRCCOMN.PRODA.LOAD.DLN(CONVBDGA) AMODE(31),RMODE(ANY)
Sg Offset Len/Ent Program-ID Trn-Date Program-Description
0 1348 5655G5300 2007/03/28 Enterprise COBOL for z/OS and OS/390
Help please I did the following and it finds nothing, what am I doing wrong ?
The input is a VBA file
Help Please this is the format of the file I am reading any my code below, it does not output anything.
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: