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

Hello,

I read the post above - thank Tom for the solution.

In my case, I have a similar issue and tried with Tom's recommendation - But I cannot resolve the issue.

Anyone have suggestion? Thank you

 

PhanS_0-1673452408397.png

PhanS_1-1673452469954.png

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

I uploaded your files to OnDemand, no issues. 

I changed the names to lowercase and they work fine.

 

BN is empty, 

P.. has 558 variables and 605 observations

BN_Save has 674 variables and 559 observations.

 

 

View solution in original post

30 REPLIES 30
ballardw
Super User

What do you expect as a resolution?

 

 

PhanS
Obsidian | Level 7

Thank you.

SAS 7bdat file cannot be opened - this is my concern.

Therefore, I can ran my SAS codes.  

PhanS_0-1673458716100.png

 

PhanS
Obsidian | Level 7

Hello,

I am very sorry - I missed my reply to you earlier. I was in and out my PC. 

You can see other helps and my responses.

Reeza
Super User

There is no issue, it's a note that processing may take longer than expected. If you want to resolve it, convert it to a native format but that would mean recreating the data. Which your last step does, so using the data in the new library (OUT) wouldn't have the same message.

 


@PhanS wrote:

Hello,

I read the post above - thank Tom for the solution.

In my case, I have a similar issue and tried with Tom's recommendation - But I cannot resolve the issue.

Anyone have suggestion? Thank you

 

PhanS_0-1673452408397.png

PhanS_1-1673452469954.png

 

 

 


 

PhanS
Obsidian | Level 7

Hello,

Thank you - how long it would take?. 

Last night and this morning, I did - but SAS 7bdat still cannot be opened. So, I cannot ran any my codes.

PhanS_0-1673459018727.png

 

Tom
Super User Tom
Super User

How long depends on the size or the dataset(s) and the speed of your computer and the disks being used to store the dataset.

 

But that note should not prevent you from using the existing dataset.

If you cannot use the existing dataset then you cannot copy it to a new format.

 

I suspect that perhaps your real issue is something else.

 

Can you show what happens if you attempt to use the dataset for something?  For example can you run PROC MEANS against it?

 

 

Note: Please post logs as text and not pictures.

PhanS
Obsidian | Level 7

Hi Tom,

Please see below - and in the attachment 

libname in '/home/phan.sok/Data_foreign';
run;

libname in '/home/phan.sok/Data_foreign';
libname out '/home/phan.sok/Data_recover';
proc copy inlib=in outlib=out noclone datecopy;
run;

/*log file
1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
68
69 libname in '/home/phan.sok/Data_foreign';
NOTE: Libref IN refers to the same physical library as AS.
NOTE: Libref IN was successfully assigned as follows:
Engine: V9
Physical Name: /home/phan.sok/Data_foreign
70 libname out '/home/phan.sok/Data_recover';
NOTE: Libref OUT was successfully assigned as follows:
Engine: V9
Physical Name: /home/phan.sok/Data_recover
71 proc copy inlib=in outlib=out noclone datecopy;
72 run;

NOTE: Copying IN.BN to OUT.BN (memtype=DATA).
NOTE: Data file IN.BN.DATA is in a format that is native to another host, or the
file encoding does not match the session encoding. Cross Environment Data
Access will be used, which might require additional CPU resources and might
reduce performance.
NOTE: System Options for BUFSIZE and REUSE were used at user's request.
NOTE: Libname and/or system options for compress, pointobs, data representation and
encoding attributes were used at user's request.
NOTE: There were 0 observations read from the data set IN.BN.
NOTE: The data set OUT.BN has 0 observations and 674 variables.
NOTE: PROCEDURE COPY used (Total process time):
real time 0.02 seconds
user cpu time 0.02 seconds
system cpu time 0.00 seconds
memory 2281.12k
OS Memory 22440.00k
Timestamp 01/11/2023 06:57:25 PM
Step Count 141 Switch Count 1
Page Faults 0
Page Reclaims 323
Page Swaps 0
Voluntary Context Switches 39
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 272
*/
option nodate nonumber ps=65 ls=85;
libname out '/home/phan.sok/Data_recover';
run;

data bn_T;
set out.bn;
run;
/*log file
1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
68
69 option nodate nonumber ps=65 ls=85;
70 libname out '/home/phan.sok/Data_recover';
NOTE: Libref OUT was successfully assigned as follows:
Engine: V9
Physical Name: /home/phan.sok/Data_recover
71 run;
72
73 data bn_T;
74 set out.bn;
75 run;

NOTE: There were 0 observations read from the data set OUT.BN.
NOTE: The data set WORK.BN_T has 0 observations and 674 variables.
NOTE: DATA statement used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 1816.18k
OS Memory 21932.00k
Timestamp 01/11/2023 06:58:31 PM
Step Count 147 Switch Count 2
Page Faults 0
Page Reclaims 290
Page Swaps 0
Voluntary Context Switches 16
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 264


76
77 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
87
*/

Tom
Super User Tom
Super User

Looks like it worked, but since there are zero observations there is nothing there for you use.

NOTE: There were 0 observations read from the data set IN.BN.
NOTE: The data set OUT.BN has 0 observations and 674 variables.

I worry that there are zero because you previously overwrote the original file.  Do you have a backup?

 

Another possibility is that that you had previously and an error and the system option OBS was set to zero.

 

You might try the copy step in a new SAS session and see if the finds more than zero observations to copy.

PhanS
Obsidian | Level 7

Hello Tom,

I do have a backup for this file in several locations in my pc and my external disks.

I restarted and reuploaded some of the files but none of them can be opened. 

Please note this file, and others of my SAS files (prior 2018), I used a SAS license and saved them. They appear that all of these files cannot be opened with SAS on Demand. 

 

I also used data transfer in SPSS - but they still cannot transfer/open.

However, I tested several of my SAS files (after 2018), which I worked with SAS studio - they have no issue; they all can be transferred to SPSS data as well.    

Any advice on this.

Thank you!

 

    

Tom
Super User Tom
Super User

I cannot think of why a file created around 2015 to 2018 would not be usable.

Unless they were made on an IBM mainframe.  Files made with SAS version 9 on windows or linux machines should be cross platform readable.

Perhaps your transfer method or backup method corrupted the older files?

 

If you made the files with SAS version 6 (.ssd or .ssd01 file extension) then you cannot read them with SAS version 9.

Tom
Super User Tom
Super User

Look at the actual content of the file and see if they are in fact SAS datasets.

For example here is code to dump the first 240 bytes of a SAS dataset, a SAS transport file made with PROC CPORT, and a SAS version 5 transport file.

1865  options ls=132 ps=60;
1866
1867  data _null_;
1868    infile "%sysfunc(pathname(work))/class.sas7bdat" lrecl=80 recfm=f obs=3;
1869    input;
1870    list;
1871  run;

NOTE: The infile ...
      RECFM=F,LRECL=80,File Size (bytes)=131072,
      Last Modified=11Jan2023:18:13:41,
      Create Time=11Jan2023:18:11:37

RULE:     ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0

1   CHAR  ............Âê.`³..Ͻ’...Ç1Œ...."".33..2................"".33..2.3.#3.>.........
    ZONE  000000000000CE86B11CB9000C381111220330030000000000001111220330030302303001000000
    NUMR  0000000000002A10341FD280971C8F01220331224000000000318F0122033122431330E000310000

2   CHAR  ....SAS FILECLASS                           ................................DATA
    ZONE  00005452444444455222222222222222222222222222000000000000000000000000000000004454
    NUMR  0000313069C53C133000000000000000000000000000000000000000000000000000000000004141

3   CHAR      ....žïgõ¼£ÝAžïgõ¼£ÝA.....”ÑÀ.....”ÑÀ....................9.0401M5X64_10PRO...
    ZONE  222200009E6FBAD49E6FBAD4000009DC000009DC0000000000000000000032333343533533554000
    NUMR  00000000EF75C3D1EF75C3D10000041000000410001000101000000000009E0401D5864F1002F000
NOTE: 3 records were read from the infile ...
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.01 seconds


1872  data _null_;
1873    infile "%sysfunc(pathname(work))/class.cport" lrecl=80 recfm=f obs=3;
1874    input;
1875    list;
1876  run;

NOTE: The infile ...\class.cport,
      RECFM=F,LRECL=80,File Size (bytes)=1840,
      Last Modified=11Jan2023:18:13:41,
      Create Time=11Jan2023:18:11:37

RULE:     ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0
1         **COMPRESSED** **COMPRESSED** **COMPRESSED** **COMPRESSED** **COMPRESSED********

2   CHAR  LIB CONTROL X64_10PR¼. SAS9.4¼ƒI¼¥D901WORK¼‚CLASS¼™VC5¼‚RC19¼ˆRL40¼ˆ1¼‡S 0  0  0
    ZONE  44424445544253353355B02545323B84BA43335454B844455B9543B85433B85433B83B8523223223
    NUMR  C9203FE42FC0864F1002C603139E4C39C549017F2BC23C133C9635C22319C82C40C81C7300000000

3   CHAR    NO¼„0¼‰1¼•wlt1¼‚¼.¼‚¼Î¼ÎSPAN CONTROL -7¼‚40¼…1¼†40¼ŠL¼ˆ40¼Ž¼&¼¦SPAN CONTROL -1
    ZONE  2244B83B83B97673B8B0B8BCBC554424445544223B833B83B833B84B833B8B2BA554424445544223
    NUMR  00EFC40C91C57C41C2C2C2CECE301E03FE42FC0D7C240C51C640CACC840CEC6C6301E03FE42FC0D1
NOTE: 3 records were read from the infile ...
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds


1877  data _null_;
1878    infile "%sysfunc(pathname(work))/class.xport" lrecl=80 recfm=f obs=3;
1879    input;
1880    list;
1881  run;

NOTE: The infile "...\class.xport,
      RECFM=F,LRECL=80,File Size (bytes)=2080,
      Last Modified=11Jan2023:18:13:41,
      Create Time=11Jan2023:18:12:00

RULE:     ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0
1         HEADER RECORD*******LIBRARY HEADER RECORD!!!!!!!000000000000000000000000000000
2         SAS     SAS     SASLIB  9.4     X64_10PR                        11JAN23:18:13:42
3         11JAN23:18:13:42
NOTE: 3 records were read from the infile 
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds


Reeza
Super User
proc datasets lib=in details;
run;quit;

Please post the output from the code above to ensure you have data.

PhanS
Obsidian | Level 7

Hi Reeza

Please kindly see the outcome

PhanS_0-1673464132895.png

 

Reeza
Super User
I agree with Tom's assessment. Replace your IN data set from a back up if you have one. Something likely wrecked that file and you need to recover it.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

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
  • 30 replies
  • 1295 views
  • 6 likes
  • 7 in conversation