BookmarkSubscribeRSS Feed
Sivanandam
Calcite | Level 5
My input flat file consist of data

store modelid
------------------
1 4216 6952
2 6054 6952
3 6139 6139
4 6215 6952
5 6240 6240
6 6332 6332


My concern is I want to move the store and the model id from the flat file to the below code .In infile and the file statement the data should move like a loop which satisfy my requirement.Could you help me in this

data output;
infile'xo94.control.userview(“srgm”modelid)';
input;
file'xo94.control.userview(“srgm”store)';
put _infile_;
run;
7 REPLIES 7
Cynthia_sas
SAS Super FREQ
Hi:
I suggest that you read a bit more about how the DATA step operates. The DATA step operates with implicit loop control. Generally, unless you alter the default behavior, the DATA step will loop one time for every observation that you read with a SET statement or an INFILE statement ("raw" data line).

I suggest you read this entire section of the doc:
http://support.sas.com/documentation/cdl/en/lrcon/62955/HTML/default/viewer.htm#/documentation/cdl/e...

and pay particular attention to the topics entitled:
"Flow of Action" and "What Causes a DATA Step to Stop Executing" and "Processing a DATA Step: A Walkthrough"

cynthia
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Guessing your SAS operating system is z/OS (IBM mainframe) and you want to stow a unique PDS/PDSE library member, based on data content. Review using the FILEVAR= keyword on the FILE statement.

For future posts, it's best to share as much info about your SAS environment, with version, operating system, local or remote SAS installed/accessed, new code / program or existing, and as you have done, share all code, though preferably as a pasted content from your SAS-generated log output.

Scott Barry
SBBWorks, Inc.

Suggested Google advanced search arguments, this topic/post:

data step filevar site:sas.com

data step file statement filevar write pds member site:sas.com Message was edited by: sbb
Sivanandam
Calcite | Level 5
Hi Scott,
Thanks,File var statement satisfied half of my requirement and am working in that ..


Thanks,
Siva.
Sivanandam
Calcite | Level 5
Is it possible to create the PDS memeber in sas..i need to get the member name from the flat file and need to create the PDS member of that name
Sivanandam
Calcite | Level 5
Is it possible to create the PDS memeber in sas..i need to get the member name from the flat file and need to create the PDS member of that name
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Yes, as I conveyed in my prior post-reply. Check the SAS support website resources as well as the SAS z/OS companion documentation - the use of the FILEVAR= parameter is your key point to investigate.

Scott Barry
SBBWorks, Inc.


Suggested Google advanced search arguments, this topic/post:

data step filevar site:sas.com

data step file statement filevar write pds member site:sas.com
Sivanandam
Calcite | Level 5
Hi Scott,
Apologise, i could not find the code ... is it possible to post the code for my requirement.

Thanks,
Siva.

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!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 7 replies
  • 825 views
  • 0 likes
  • 3 in conversation