View previous topic :: View next topic
|
Author |
Message |
ppandey07
New User
Joined: 27 Nov 2008 Posts: 51 Location: Delhi, India
|
|
|
|
Robert Sample wrote: |
The SET statement option NOBS could also be used. |
I also have one requirment that in the detail record I have to delimit fields by
hex 09(which is the tab key). How can I do that in SAS program?
Can you please advise |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
SAS is not COBOL, so please post in the appropriate forum.
What logic have you thought of and tried so far. It can be done with SAS quite easily as I have done the same thing but using '25'X as the delimiter. |
|
Back to top |
|
|
ppandey07
New User
Joined: 27 Nov 2008 Posts: 51 Location: Delhi, India
|
|
|
|
expat wrote: |
SAS is not COBOL, so please post in the appropriate forum.
What logic have you thought of and tried so far. It can be done with SAS quite easily as I have done the same thing but using '25'X as the delimiter. |
To be frank, I am new to SAS. So no idea how should I do that.
So please advise for my following question.
Lets say I have following output layout for a SAS dataset
PUT
SSN 6.
@07 ' '
CODE $ 8-17
@18 ' '
VEN_NO 8.
@27 ' '
MEMBER $ 28-37
@38 ' '
CLIENT $ 39-48
@49 ' '
CLIENT_NAME $ 50-149
Right now I am using SPACE as delimiter. Can you please advise what should I put over here. |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
@07 '09'X
etc. |
|
Back to top |
|
|
ppandey07
New User
Joined: 27 Nov 2008 Posts: 51 Location: Delhi, India
|
|
|
|
PeterHolland wrote: |
@07 '09'X
etc. |
Posted: Tue Feb 22, 2011 2:11 pm Post subject:
--------------------------------------------------------------------------------
expat wrote:
SAS is not COBOL, so please post in the appropriate forum.
What logic have you thought of and tried so far. It can be done with SAS quite easily as I have done the same thing but using '25'X as the delimiter.
To be frank, I am new to SAS. So no idea how should I do that.
So please advise for my following question.
Lets say I have following output layout for a SAS dataset
So my final output layout should be like following?
PUT
SSN 6.
@07 '09'X
CODE $ 8-17
@18 '09'X
VEN_NO 8.
@27 '09'X
MEMBER $ 28-37
@38 '09'X
CLIENT $ 39-48
@49 '09'X
CLIENT_NAME $ 50-149 |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
Yep, and dont forget the terminating ";" at CLIENT_NAME $ 50-149;
And change your CODE $ 8-17 to CODE $CHAR10. and accordingly also
your other character fields.
And read the :
SAS Language Reference |
|
Back to top |
|
|
ppandey07
New User
Joined: 27 Nov 2008 Posts: 51 Location: Delhi, India
|
|
|
|
PeterHolland wrote: |
Yep, and dont forget the terminating ";" at CLIENT_NAME $ 50-149;
And change your CODE $ 8-17 to CODE $CHAR10. and accordingly also
your other character fields.
And read the :
SAS Language Reference |
Okay thanks. One last question. if I want to initialize 2 fields by spaces, how can I do that? |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
You could actually read the manuals |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Quote: |
if I want to initialize 2 fields by spaces, how can I do that?
|
How about
Code: |
FIELD1 = ' ';
FIELD2 = ' ' ; |
WWW.SAS.COM has all the manuals available and you could read them online -- or buy a book on SAS? |
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
|
|
|
|
Hi,
For EBCDIC '05'x is tab.
'09'x is tab for ASCII.
Thanks, |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
vasanthz,
thats right. My bad. But what if the TS is using SAS for the PC? See his first post. |
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
|
|
|
|
Oh ok u are right, TS must be using PC SAS |
|
Back to top |
|
|
|