IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Delimit records by tab key using SAS


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ppandey07

New User


Joined: 27 Nov 2008
Posts: 51
Location: Delhi, India

PostPosted: Tue Feb 22, 2011 11:32 am
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Feb 22, 2011 1:04 pm
Reply with quote

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
View user's profile Send private message
ppandey07

New User


Joined: 27 Nov 2008
Posts: 51
Location: Delhi, India

PostPosted: Tue Feb 22, 2011 2:11 pm
Reply with quote

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
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Tue Feb 22, 2011 3:03 pm
Reply with quote

@07 '09'X

etc.
Back to top
View user's profile Send private message
ppandey07

New User


Joined: 27 Nov 2008
Posts: 51
Location: Delhi, India

PostPosted: Tue Feb 22, 2011 4:03 pm
Reply with quote

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
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Tue Feb 22, 2011 4:30 pm
Reply with quote

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
View user's profile Send private message
ppandey07

New User


Joined: 27 Nov 2008
Posts: 51
Location: Delhi, India

PostPosted: Tue Feb 22, 2011 5:28 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Feb 22, 2011 5:32 pm
Reply with quote

You could actually read the manuals
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue Feb 22, 2011 5:33 pm
Reply with quote

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
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Tue Feb 22, 2011 5:33 pm
Reply with quote

Hi,
Quote:
@07 '09'X


For EBCDIC '05'x is tab.
'09'x is tab for ASCII.

Thanks,
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Tue Feb 22, 2011 6:09 pm
Reply with quote

vasanthz,

thats right. My bad. But what if the TS is using SAS for the PC? See his first post.
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Tue Feb 22, 2011 6:18 pm
Reply with quote

Oh ok u are right, TS must be using PC SAS icon_smile.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> All Other Mainframe Topics

 


Similar Topics
Topic Forum Replies
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Join multiple records using splice DFSORT/ICETOOL 5
No new posts EZT program to build a flat file with... All Other Mainframe Topics 9
No new posts JCL sortcard to print only the records DFSORT/ICETOOL 11
Search our Forums:

Back to Top