Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Increase the width of the column greater than 256 in SAS

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics
View previous topic :: :: View next topic  
Author Message
sakrat

Active User


Joined: 05 Feb 2014
Posts: 159
Location: India

PostPosted: Tue May 12, 2015 6:20 pm    Post subject: Increase the width of the column greater than 256 in SAS
Reply with quote

Hi,

Can some one tell if there is any way to give the length of the column in SAS greater than 256 my column needs 540 length but that is showing error when i try to execute with 540.

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

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7226

PostPosted: Tue May 12, 2015 6:23 pm    Post subject: Reply to: Increase the width of the column greater than 256 in SAS
Reply with quote

How about showing your code and the full message you got?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7908
Location: Bellevue, IA

PostPosted: Tue May 12, 2015 11:03 pm    Post subject:
Reply with quote

Your post is not clear -- are you talking about a PROC SQL column? a SAS variable? something else entirely? With SAS variables, you can use a LENGTH statement to make a character variable anything up to 32767 bytes.
Back to top
View user's profile Send private message
sakrat

Active User


Joined: 05 Feb 2014
Posts: 159
Location: India

PostPosted: Tue May 12, 2015 11:20 pm    Post subject:
Reply with quote

Robert Sample wrote:
Your post is not clear -- are you talking about a PROC SQL column? a SAS variable? something else entirely? With SAS variables, you can use a LENGTH statement to make a character variable anything up to 32767 bytes.



I am talking about the SAS variable. I declared it using the LENGTH but still its shows an error message.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7908
Location: Bellevue, IA

PostPosted: Tue May 12, 2015 11:35 pm    Post subject:
Reply with quote

Show us your SAS code.
Back to top
View user's profile Send private message
sakrat

Active User


Joined: 05 Feb 2014
Posts: 159
Location: India

PostPosted: Wed May 13, 2015 12:18 am    Post subject: Reply to: Increase the width of the column greater than 256 in SAS
Reply with quote

Here is my SAS code below:

Code:


//STEP05    EXEC    SAS
//INPFILE    DD       DSN=&&TEMP,DISP=SHR
//OUTPFLE   DD      DSN=FILE1.NAME,DISP=SHR
//SYSIN       DD     *                           
   OPTIONS  NODATE NONUMBER NOCENTER LINESIZE=256 MISSING=' ';
   TITLE;
   DATA  FILE1;
   INFILE  INPFILE;
   INPUT
      @1    CTYPE      $3.
      @4    C1           $1.
      @5    JNAME      $8.
      @13  C2            $1.
      @14  OWNER     $3.
      @17  C3            $1.
      @18 TNAME       $7.                                               
      @25  C4            $1.
      @26  DESC        $27.
      @53  C5            $1.
      @54  WDAYS     $30.
      @84  C6            $1.
      @85  CAL          $3.
      @88  C7            $1.
      @89  ALERT       $4.
      @93  C8            $1.
      @94  MAXWAIT  $1.
      @95  C9            $1.
      @96  JOBS        $8.
      @105 C10         $1.
      @106 COND      $19.
      @125 C11         $1.
      @126 FRMTIME  $4.
      @130 C12         $1.
      @131 SETV       $4.
      @135 C13         $1.
      @136 NPD         $1.
      @137 C14         $1.
      @138 EXSD       $4.
      @142 C15         $1.
      @143 RCD         $4.                       
      @147 C16         $1.
      @148 JOBNAME $8.

DATALINES;
RUN;
DATA FILE2;
LENGTH  C $1;
C= ',';
LENGTH CHNGTYPE   $3.;
LENGTH JBNAME     $8.;
LENGTH  OWNERID   $3.;
LENGTH   TABNAME  $8.;
LENGTH   DESCRIPTION   $540.;
LENGTH    WORKINGDAYS   $120.;
LENGTH     CALENDAR    $3.;
LENGTH    ALERTTYPE   $4.;
LENGTH     MAXWAIT   $4.;
LENGTH    CONDITION   $480.;
LENGTH    FROMTIME   $4.;
LENGTH      SETVARIABLE   $4.;
LENGTH      RUNPERDAY     $1.;
LENGTH    EXCLUSIVESHRD    $4.;
LENGTH    RETURNCODE    $4.;

DO UNTIL(LAST.JOBNAME);
     SET FILE1;
     BY JOBNAME NOTSORTED;
     CHNGTYPE=CATX(' ',CHNGTYPE,CTYPE);
     JBNAME=CATX(' ',JBNAME,JNAME);
     OWNERID=CATX(' ',OWNERID,OWNER);
     TABNAME=CATX(' ',TABNAME,TNAME);
     DESCRITION=CATX(' ',DESCRIPTION,DESC);
     WORKINGDAYS=CATX(' ',WORKINGDAYS,WDAYS);
     CALENDAR=CATX(' ',CALENDAR,CAL);
     ALERTTYPE
     MAXWAIT
     CONDITION
     FROMTIME
     SETVARIABLE
     RUNPERDAY
    EXCLUSIVESHRD
    RETURNCODE
    ;
RUN;

FILE OUTPFLE;
PUT
@1  CHNGTYPE $3.
@4  C  $1.
@5     JBNAME   $8.
@13   C $1.
@14    OWNERID   $3.
@17   C  $1.
@18    TABNAME   $8.
@26   C $1.
@27   DESCRIPTION    $540.
@567 C $1.
@568   WORKINGDAYS  $120.
@688   C  $1.
@689    CALENDAR $3.
@692    C $1.
@693   ALERTTYPE    $4.
@697     C  $1.
@698   MAXWAIT   $1.
@699    C $1.
@700    CONDITION  $480.
@1180   C   $1.
@1181    FROMTIME    $4.
@1185    C    $1.
@1186   SETVARIABLE    $4.
@1190      C   $1.
@1191   RUNPERDAY    $1.
@1192   C   $1.
@1193  EXCLUSIVESHRD  $4.
@1197   C   $1.
@1198  RETURNCODE   $1.
;
PROC REPORT  DATA=FILE2 NOWINDOWS;
RUN;





The same code syntax is used for ALERTTYPE to RETURNCODE as well like above used CATX syntax.



And I get error like "the width of the "variable" is not between 1 and 256 adjust the column width or the line size.
Back to top
View user's profile Send private message
sakrat

Active User


Joined: 05 Feb 2014
Posts: 159
Location: India

PostPosted: Wed May 13, 2015 12:23 am    Post subject:
Reply with quote

Also I ran the code by removing LINESIZE=256 in the OPTIONS but even then I get the same error message...
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7908
Location: Bellevue, IA

PostPosted: Wed May 13, 2015 3:49 am    Post subject:
Reply with quote

Rather than telling us what the error is "like" -- post the code with the error message in it as it helps us to see where SAS considers the problem to lie. And by the way, LINESIZE has nothing to do with variable widths -- LINESIZE tells SAS how long each line of the SAS log is.

It would also help if you describe (with a few input records) what your input consists of and what you are attempting to produce for output. It appears you are attempting to create a comma-delimited file from the input; if so, why not use PROC EXPORT? Why do you think you need the CATX function?
Back to top
View user's profile Send private message
sakrat

Active User


Joined: 05 Feb 2014
Posts: 159
Location: India

PostPosted: Wed May 13, 2015 11:50 am    Post subject:
Reply with quote

Robert Sample wrote:
Rather than telling us what the error is "like" -- post the code with the error message in it as it helps us to see where SAS considers the problem to lie. And by the way, LINESIZE has nothing to do with variable widths -- LINESIZE tells SAS how long each line of the SAS log is.

It would also help if you describe (with a few input records) what your input consists of and what you are attempting to produce for output. It appears you are attempting to create a comma-delimited file from the input; if so, why not use PROC EXPORT? Why do you think you need the CATX function?


The below is the error message which I got :

Code:


111          PROC REPORT DATA=FILE2 NOWINDOWS;
112          RUN;

ERROR: The width of DESCRIPTION is not between 1 and 256. Adjust the column widt
NOTE: This affects LISTING output.



and my input records wil be like below:

Code:


A,         ,C,D1,E,F
              D2   F
              D3   F
   B1 IN           F
   B2 IN           F
   B3 IN           F



output dataset will have

Code:


A,B1 IN B2 IN B3 OUT,C,D1 D2 D3,E,F



so here the column width of the B1 IN B2 IN B3 OUT shoulf be maximum of 480 and D1 D2 D3 should be maximum 540 but i get error for this.

I am using CATX since I need to include all the D1 D2 and D3 in the same line between the comma and the same way for other column as well.

Also I am trying to add a comma after the last IN in the each record so that B1 IN B2 IN and B3 OUT goes to two separate column in excel when it it sent mail as CSV format.
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1445
Location: Azeroth

PostPosted: Wed May 13, 2015 1:39 pm    Post subject:
Reply with quote

Hello,

You would get the above error if you are trying to print anything with PROC REPORT that is over 256 characters.

The below program would produce the same error.

Code:
OPTIONS LINESIZE=256;
DATA WELLS;
LENGTH DESCRIPTION $540;
DESCRITION = "GOT INTO A BATTLE WITH AN ARMY OF ANTS FOR THE COVETED BRITTANIA RUSK, AFTER A LONG
STRUGGLE, I AM TYPING THIS LONG STRING AND THEY ARE'NT";
RUN;
PROC REPORT DATA = WELLS NOWD; RUN;


To overcome this, you could use PROC PRINT instead of PROC REPORT.

Code:
PROC PRINT  DATA=FILE2;
RUN;


Hope it helps.
Back to top
View user's profile Send private message
sakrat

Active User


Joined: 05 Feb 2014
Posts: 159
Location: India

PostPosted: Wed May 13, 2015 2:00 pm    Post subject:
Reply with quote

vasanthz wrote:
Hello,

You would get the above error if you are trying to print anything with PROC REPORT that is over 256 characters.

The below program would produce the same error.

Code:
OPTIONS LINESIZE=256;
DATA WELLS;
LENGTH DESCRIPTION $540;
DESCRITION = "GOT INTO A BATTLE WITH AN ARMY OF ANTS FOR THE COVETED BRITTANIA RUSK, AFTER A LONG
STRUGGLE, I AM TYPING THIS LONG STRING AND THEY ARE'NT";
RUN;
PROC REPORT DATA = WELLS NOWD; RUN;


To overcome this, you could use PROC PRINT instead of PROC REPORT.

Code:
PROC PRINT  DATA=FILE2;
RUN;


Hope it helps.


Its working now...thanks a lot..... 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    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SQZ pipe delimited file with 1 column... Rick Silvers DFSORT/ICETOOL 2 Sun Nov 06, 2016 8:11 pm
This topic is locked: you cannot edit posts or make replies. Checking wether a string starts from ... sundaram.naveen CLIST & REXX 9 Thu Oct 06, 2016 11:56 am
No new posts Increase the screen size after split mistah kurtz TSO/ISPF 2 Fri Sep 02, 2016 6:39 pm
No new posts Add system date inside of a PS file a... pramitdas DFSORT/ICETOOL 5 Sun Aug 28, 2016 12:06 am
No new posts Converting NULL column into NOT NULL ... Raghu navaikulam DB2 5 Sat Aug 06, 2016 3:45 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us