<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Format definition problem in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Format-definition-problem/m-p/727802#M28222</link>
    <description>&lt;P&gt;thanks, but I still can't use this.&lt;/P&gt;&lt;P&gt;Goal: I want a Format or informat to turn a character variable into a numeric one.&lt;/P&gt;&lt;P&gt;I simplified the first dataset and typed:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;/* Monatsformate für Erfolgsplan 																*/
data erfgpln;
length start $2 label 3;
input start label;
datalines;
A 1
B 2
C 3
D 4
E 5
F 6
G 7
H 8
I 9
J 10
K 11
L 12
M 21
N 22
O 23
P 24
Q 25
R 26
S 27
T 28
U 29
V 30
W 31
X 32
Y 33
;
run;
data erfgplnf;
set erfgpln end=last;
retain fmtname 'Erfgplnf' type 'f';
output;
run;
proc format cntlin=erfgplnf fmtlib; run;&lt;/PRE&gt;&lt;P&gt;I get the following Display in the Formats:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;                            ----------------------------------------------------------------------------                            
                            |       FORMAT NAME: ERFGPLNF LENGTH:    2   NUMBER OF VALUES:    1        |                            
                            |   MIN LENGTH:   1  MAX LENGTH:  40  DEFAULT LENGTH:   2  FUZZ: STD       |                            
                            |--------------------------------------------------------------------------|                            
                            |START           |END             |LABEL  (VER. V7|V8   19MAR2021:17:30:29)|                            
                            |----------------+----------------+----------------------------------------|                            
                            |               .|               .|33                                      |                            
                            ----------------------------------------------------------------------------                            &lt;/PRE&gt;&lt;P&gt;which doesn't help to operate what I want.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What has to be modified?&lt;/P&gt;</description>
    <pubDate>Fri, 19 Mar 2021 16:35:23 GMT</pubDate>
    <dc:creator>PierreYvesILY</dc:creator>
    <dc:date>2021-03-19T16:35:23Z</dc:date>
    <item>
      <title>Format definition problem</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Format-definition-problem/m-p/727789#M28219</link>
      <description>&lt;P&gt;hello dear SAS experts,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I typed the following Code to define a numeric Format out of a character one:&lt;/P&gt;&lt;PRE&gt;/* Monatsformate für Erfolgsplan 																*/
data erfgpln;
length start $8 label 8;
input start label;
datalines;
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
10 10
11 11
12 12
JanMoy 21
FebMoy 22
MarMoy 23
AprMoy 24
MaiMoy 25
JunMoy 26
JulMoy 27
AugMoy 28
SepMoy 29
OctMoy 30
NovMoy 31
DecMoy 32
Jahr 33
;
run;
data erfgplnf;
set erfgpln end=last;
retain fmtname 'Erfgplnf' type 'n';
output;
run;
proc format cntlin=erfgplnf fmtlib;run;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I got the following error message:&lt;/P&gt;&lt;PRE&gt;63         proc format cntlin=erfgplnf fmtlib;
ERROR: For format ERFGPLNF, this range is repeated, or values overlap: .-..&lt;/PRE&gt;&lt;P&gt;How can I fix this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;PY&lt;/P&gt;</description>
      <pubDate>Fri, 19 Mar 2021 15:53:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Format-definition-problem/m-p/727789#M28219</guid>
      <dc:creator>PierreYvesILY</dc:creator>
      <dc:date>2021-03-19T15:53:07Z</dc:date>
    </item>
    <item>
      <title>Re: Format definition problem</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Format-definition-problem/m-p/727792#M28220</link>
      <description>Type must be C for a character format as your starting values, "start" is a character. &lt;BR /&gt;Once you change that it works fine.</description>
      <pubDate>Fri, 19 Mar 2021 16:01:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Format-definition-problem/m-p/727792#M28220</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-03-19T16:01:07Z</dc:date>
    </item>
    <item>
      <title>Re: Format definition problem</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Format-definition-problem/m-p/727795#M28221</link>
      <description>&lt;P&gt;What does this phrase mean?&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;define a numeric Format out of a character one&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Your start values have character strings "JanMoy" etc.&amp;nbsp; So to convert that into a format you would need a character format not a numeric format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is your goal to create an INFORMAT instead of a FORMAT?&lt;/P&gt;
&lt;P&gt;In that case use J as the TYPE.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then you could use the new INFORMAT with an INPUT statement or INPUT() function call.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;number = input('JanMoy',erfgpln.);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Mar 2021 16:07:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Format-definition-problem/m-p/727795#M28221</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-03-19T16:07:16Z</dc:date>
    </item>
    <item>
      <title>Re: Format definition problem</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Format-definition-problem/m-p/727802#M28222</link>
      <description>&lt;P&gt;thanks, but I still can't use this.&lt;/P&gt;&lt;P&gt;Goal: I want a Format or informat to turn a character variable into a numeric one.&lt;/P&gt;&lt;P&gt;I simplified the first dataset and typed:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;/* Monatsformate für Erfolgsplan 																*/
data erfgpln;
length start $2 label 3;
input start label;
datalines;
A 1
B 2
C 3
D 4
E 5
F 6
G 7
H 8
I 9
J 10
K 11
L 12
M 21
N 22
O 23
P 24
Q 25
R 26
S 27
T 28
U 29
V 30
W 31
X 32
Y 33
;
run;
data erfgplnf;
set erfgpln end=last;
retain fmtname 'Erfgplnf' type 'f';
output;
run;
proc format cntlin=erfgplnf fmtlib; run;&lt;/PRE&gt;&lt;P&gt;I get the following Display in the Formats:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;                            ----------------------------------------------------------------------------                            
                            |       FORMAT NAME: ERFGPLNF LENGTH:    2   NUMBER OF VALUES:    1        |                            
                            |   MIN LENGTH:   1  MAX LENGTH:  40  DEFAULT LENGTH:   2  FUZZ: STD       |                            
                            |--------------------------------------------------------------------------|                            
                            |START           |END             |LABEL  (VER. V7|V8   19MAR2021:17:30:29)|                            
                            |----------------+----------------+----------------------------------------|                            
                            |               .|               .|33                                      |                            
                            ----------------------------------------------------------------------------                            &lt;/PRE&gt;&lt;P&gt;which doesn't help to operate what I want.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What has to be modified?&lt;/P&gt;</description>
      <pubDate>Fri, 19 Mar 2021 16:35:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Format-definition-problem/m-p/727802#M28222</guid>
      <dc:creator>PierreYvesILY</dc:creator>
      <dc:date>2021-03-19T16:35:23Z</dc:date>
    </item>
    <item>
      <title>Re: Format definition problem</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Format-definition-problem/m-p/727803#M28223</link>
      <description>&lt;P&gt;I also typed :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;data erfgplnf;
set erfgpln end=last;
retain fmtname 'Erfgplnf' type 'J';
output;
run;
proc format cntlin=erfgplnf fmtlib; run;&lt;/PRE&gt;&lt;P&gt;same result&lt;/P&gt;</description>
      <pubDate>Fri, 19 Mar 2021 16:37:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Format-definition-problem/m-p/727803#M28223</guid>
      <dc:creator>PierreYvesILY</dc:creator>
      <dc:date>2021-03-19T16:37:57Z</dc:date>
    </item>
    <item>
      <title>Re: Format definition problem</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Format-definition-problem/m-p/727807#M28224</link>
      <description>The code you've shown creates a format but doesn't really produce any output that you can see so not sure what's you're expecting to see in that output. &lt;BR /&gt;Show us how you intend to use this format and maybe we can help clarify how the code should be structured for your problem. &lt;BR /&gt;</description>
      <pubDate>Fri, 19 Mar 2021 16:53:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Format-definition-problem/m-p/727807#M28224</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-03-19T16:53:36Z</dc:date>
    </item>
    <item>
      <title>Re: Format definition problem</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Format-definition-problem/m-p/727818#M28225</link>
      <description>&lt;P&gt;Note that formats convert values to text.&amp;nbsp; Informats convert text to values.&lt;/P&gt;
&lt;P&gt;Numeric formats work on numeric values.&amp;nbsp; Character formats work on character values.&amp;nbsp; Numeric informats create numeric values.&amp;nbsp; Character informats create character values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To convert text to numbers you need a numeric informat.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your original data is fine for defining a numeric INFORMAT, just use 'J' as the TYPE.&lt;/P&gt;
&lt;PRE&gt;789   data erfgplnf;
790     set erfgpln end=last;
791     retain fmtname 'Erfgplnf' type 'J';
792   run;

NOTE: There were 25 observations read from the data set WORK.ERFGPLN.
NOTE: The data set WORK.ERFGPLNF has 25 observations and 4 variables.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds


793   
794   proc format cntlin=erfgplnf fmtlib;
NOTE: Informat $ERFGPLNF has been output.
794 !                                    run;

NOTE: PROCEDURE FORMAT used (Total process time):
      real time           0.13 seconds
      cpu time            0.03 seconds
&lt;/PRE&gt;</description>
      <pubDate>Fri, 19 Mar 2021 17:20:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Format-definition-problem/m-p/727818#M28225</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-03-19T17:20:10Z</dc:date>
    </item>
    <item>
      <title>Re: Format definition problem</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Format-definition-problem/m-p/727825#M28228</link>
      <description>&lt;P&gt;eza,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank you very much for your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I posted a longer topic to explain my concern:&lt;/P&gt;&lt;P&gt;&lt;A href="https://communities.sas.com/t5/New-SAS-User/Pb-when-I-use-an-informat-I-defined/td-p/727822" target="_blank"&gt;https://communities.sas.com/t5/New-SAS-User/Pb-when-I-use-an-informat-I-defined/td-p/727822&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this will clear the problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Mar 2021 17:29:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Format-definition-problem/m-p/727825#M28228</guid>
      <dc:creator>PierreYvesILY</dc:creator>
      <dc:date>2021-03-19T17:29:34Z</dc:date>
    </item>
  </channel>
</rss>

