BookmarkSubscribeRSS Feed
bill73
Calcite | Level 5

The Program is a variation of Tom Zack's Program R2COB2 in the set of COB2SASThe Program is a variation of Tom Zack's Program R2COB2 in the set of COB2SAS

7 REPLIES 7
ChrisNZ
Tourmaline | Level 20

Welcome to the SAS community!

1.What are you trying to do?

2.What is your question?

3.If you want to extract the path of the WORK library, I suspect the macro supplied is no longer needed, and you simply should use the pathname() function. 

 

ScottBass
Rhodochrosite | Level 12

It works for me


Please post your question as a self-contained data step in the form of "have" (source) and "want" (desired results).
I won't contribute to your post if I can't cut-and-paste your syntactically correct code into SAS.
bill73
Calcite | Level 5

When installing SAS on an IBM-Host (z13-1), you get a set of programs from an SAS-programmer, Tom Zack, from early 1990, but they are still working very good. You can use them to convert Cobol data structures to SAS data structures. You only need the following 7 programs of this set:

R2MVS as leading program;

R2COB1, R2COB2, R2COB3, R2COB4, R2COB5 and R2COB6.

We now want to transfer our SAS-Programs from IBM-Host to WTS-Linux.

Then you have to mark typical Host-Formats, especially for packed decimal fields, so that you derive the host origin as shown in the table (see Attachments).

The only Program to do this is the R2COB2 and we label this program variation as R2COB2GD.

At the host the EG-Project works very well; we used the CP1-Cobol-data-structure of Tom Zack for testing..

After Migration of this project to WTS-Linux in accordance to our guidance, the project runs without any errors, but it doesn’t work as designed.

The datasets “group” and “dictionary” as result datasets in the R2COB2 are empty.

We hoped, that the Data-Step-Debugger will help us, to understand the problem.

But then the error occurs: Error in transfering of the SAS-Code (Translation from the german error message); “unrecognized command: run;”. This error message occurs even after eliminating the first If-Statement:

IF _N_ = 1 THEN DO;                                                        

       SET SWITCHES;

END; /* IF _N_ = 1 */

 

This statement was redundant, because the dataset “work.switches” contained only 1 sentence.

So we reduce this Statement to:

SET SWITCHES;

But the same error message occurred.

Unfortunately we’ve got the same error message at the host, when we expand the data-Statement with a “/ ldebug”. Our question to the community is, if anybody knows about problems like this with the data step debugger.

So the data step debugger seems to be unsuitable in this special case. We’ll discuss the problem of Migration to WTS-Linux with our Linux-Experts. Meanwhile we have fixed the Problem. Because R2COB2 is a Parser Program, ist is important, that the read in text is positioned at the original position. With the format $EBCDICn., the leading blanks are trimmed. When keeping the $Charn.-Format, the program works on WTS-Linux as at the IBM-Host!

I think the Problem of the Data-Step-Debugger is the structured programming method, wich is used by Tom Zack in the R2COB2-Program. i.e. "Link Label; Label: Statements; return;"-technique! Is there any reference point for this finding? 

bill73

 

 

 

bill73
Calcite | Level 5

Download the attachment table, please!

ScottBass
Rhodochrosite | Level 12

@bill73 wrote:

Download the attachment table, please!


No.  Supply your SAS log, please!  (And what "attachment table" are you talking about?  A .sas program?  An Excel file?)

 

The problem isn't with the debugger, the problem is with your SAS program.  My guess is you're missing a semi-colon, and SAS gets confused about the run statement.

 

IF _N_ = 1 THEN DO;                                                        

       SET SWITCHES;

END; /* IF _N_ = 1 */

 

This statement was redundant, because the dataset “work.switches” contained only 1 sentence.

So we reduce this Statement to:

SET SWITCHES;

 

Your thinking is incorrect.  The original code will read a single row from SET SWITCHES, then retain those variables for the life of the data step, or until explicitly changed.

 

Your code change will mean a record is read from SWITCHES for each iteration of the data step.  Since SAS will end the data step on the first data set that has read past the end of data, that means your data step will only run for a single iteration.

 

I suspect you have multiple SET statements in your code, but I can't know for sure since you haven't supplied your SAS log.

 

 

 


Please post your question as a self-contained data step in the form of "have" (source) and "want" (desired results).
I won't contribute to your post if I can't cut-and-paste your syntactically correct code into SAS.
bill73
Calcite | Level 5

Excuse me, but i couldn't answer immediately, because I was ill. In the last week I got Problems with a Windows Setup for Win 7, so that i've to change to Win 10.

Your diagnose in relation to the "IF _N_ = 1 THEN DO;" -Statement is absolutely reliable. But even, if try to debug the program R2COB2 in the cob2sas-Package of Tom Zack with this IF-Statement, I'll get the same error message "error in Code Transmission". I Think, the Problem for debugging of this Code is the technique of structured programming with Link label; … label:  return; /* FRom label */.

 

Thanks!

ScottBass
Rhodochrosite | Level 12

I'm unsubscribing from this one so I won't get any further updates.

 

However, what part of "No.  Supply your SAS log, please!" did you not understand?

 

Good luck with your issue, and I'm happy you're feeling better.


Please post your question as a self-contained data step in the form of "have" (source) and "want" (desired results).
I won't contribute to your post if I can't cut-and-paste your syntactically correct code into SAS.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 7 replies
  • 2015 views
  • 2 likes
  • 3 in conversation