Help using Base SAS procedures

Moving the flatfile data to infile and file parameters

Reply
Contributor
Posts: 38

Moving the flatfile data to infile and file parameters

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;
SAS Super FREQ
Posts: 8,743

Re: Moving the flatfile data to infile and file parameters

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
Super Contributor
Super Contributor
Posts: 3,174

Re: Moving the flatfile data to infile and file parameters

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
Contributor
Posts: 38

Re: Moving the flatfile data to infile and file parameters

Hi Scott,
Thanks,File var statement satisfied half of my requirement and am working in that ..


Thanks,
Siva.
Contributor
Posts: 38

Re: Moving the flatfile data to infile and file parameters

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
Contributor
Posts: 38

Re: Moving the flatfile data to infile and file parameters

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
Super Contributor
Super Contributor
Posts: 3,174

Re: Moving the flatfile data to infile and file parameters

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
Contributor
Posts: 38

Re: Moving the flatfile data to infile and file parameters

Hi Scott,
Apologise, i could not find the code ... is it possible to post the code for my requirement.

Thanks,
Siva.
Ask a Question
Discussion stats
  • 7 replies
  • 135 views
  • 0 likes
  • 3 in conversation