BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
lyth_abb
Fluorite | Level 6

Hi - I'm trying to create new table with proc sql as below (I take it from sas guideline:

https://documentation.sas.com/doc/ja/vdmmlcdc/8.1/sqlproc/n1ncn0pznd8wrln1tnp3xdxjz9xz.htm )

The query run successfully without no error, but when I refresh the libname 'proclib' created in the code, it keeps refreshing and hasn't stopped for 3-4 hours. Can someone please explain me what's wrong here? Many thanks

Code:

 

libname proclib 'SAS-library';
proc sql;
   create table proclib.paylist
       (IdNum char(4),
        Gender char(1),
        Jobcode char(3),
        Salary num,
        Birth num informat=date7.
                  format=date7.,
        Hired num informat=date7.
                  format=date7.);
insert into proclib.paylist
    values('1639','F','TA1',42260,'26JUN70'd,'28JAN91'd)
    values('1065','M','ME3',38090,'26JAN54'd,'07JAN92'd)
    values('1400','M','ME1',29769.'05NOV67'd,'16OCT90'd)
values('1561','M',null,36514,'30NOV63'd,'07OCT87'd)
    values('1221','F','FA3',.,'22SEP63'd,'04OCT94'd);
title 'Proclib.Paylist Table';
select *
   from proclib.paylist;
proc printto; run;

The 'proclib' keeps refreshing:

Untitled.png

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Patrick
Opal | Level 21

Your code works "as is" in my SAS9.4 M7 environment under RHEL. 

Always finish a Proc SQL with a QUIT  - may-be that's the issue in your environment.

 

Here what I've run without any issues.

libname proclib "%sysfunc(pathname(work))";

proc sql;
  create table proclib.paylist
    (IdNum char(4),
    Gender char(1),
    Jobcode char(3),
    Salary num,
    Birth num informat=date7.
    format=date7.,
    Hired num informat=date7.
    format=date7.);
  insert into proclib.paylist
    values('1639','F','TA1',42260,'26JUN70'd,'28JAN91'd)
    values('1065','M','ME3',38090,'26JAN54'd,'07JAN92'd)
    values('1400','M','ME1',29769.'05NOV67'd,'16OCT90'd)
    values('1561','M',null,36514,'30NOV63'd,'07OCT87'd)
    values('1221','F','FA3',.,'22SEP63'd,'04OCT94'd);
  title 'Proclib.Paylist Table';
  select *
    from proclib.paylist;
quit;

View solution in original post

2 REPLIES 2
Patrick
Opal | Level 21

Your code works "as is" in my SAS9.4 M7 environment under RHEL. 

Always finish a Proc SQL with a QUIT  - may-be that's the issue in your environment.

 

Here what I've run without any issues.

libname proclib "%sysfunc(pathname(work))";

proc sql;
  create table proclib.paylist
    (IdNum char(4),
    Gender char(1),
    Jobcode char(3),
    Salary num,
    Birth num informat=date7.
    format=date7.,
    Hired num informat=date7.
    format=date7.);
  insert into proclib.paylist
    values('1639','F','TA1',42260,'26JUN70'd,'28JAN91'd)
    values('1065','M','ME3',38090,'26JAN54'd,'07JAN92'd)
    values('1400','M','ME1',29769.'05NOV67'd,'16OCT90'd)
    values('1561','M',null,36514,'30NOV63'd,'07OCT87'd)
    values('1221','F','FA3',.,'22SEP63'd,'04OCT94'd);
  title 'Proclib.Paylist Table';
  select *
    from proclib.paylist;
quit;
lyth_abb
Fluorite | Level 6
Oh many thanks for your quick reply, it works perfectly!!

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

How to Concatenate Values

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 153 views
  • 1 like
  • 2 in conversation