Skip to content

Commit 1863af7

Browse files
authored
Move program to PROC FORMAT folder
1 parent b1dee3f commit 1863af7

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

USING DATE DIRECTIVES ON THE PICTURE STATEMENT.sas renamed to By Syntax/FORMAT Procedure/Using Date Directives on the PICTURE Statement.sas

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,27 @@
11
/************************************************************************************************
22
USING DATE DIRECTIVES ON THE PICTURE STATEMENT
33
This program creates formats to display dates in a customized way.
4-
Keywords: PROC FORMAT, FORMAT, PICTURE, DATATYPE=
4+
Keywords: PROC FORMAT, FORMAT, PICTURE, DATATYPE
55
SAS Versions: SAS 9, SAS Viya
66
Documentation: https://documentation.sas.com/?cdcId=pgmsascdc&cdcVersion=default&docsetId=proc&docsetTarget=p1xidhqypi0fnwn1if8opjpqpbmn.htm
7-
1. The picture statement can create formats that can be used to display dates. Start by using PROC FORMAT with a PICTURE
8-
statement that has a datatype= option.
9-
2. The picture statement identifies the name of the new format. It then specifies the range of values to which a template
7+
1. The PICTURE statement can create formats that can be used to display dates. Start by using PROC FORMAT with a PICTURE
8+
statement that has a DATATYPE= option.
9+
2. The PICTURE statement identifies the name of the new format. It then specifies the range of values to which a template
1010
will be applied. Use the LOW and HIGH to keywords to indicate that the range includes everything from the lowest value
1111
to the highest.
12-
3. It then specifies a template or pattern for the format. In this case we use date directives to define the template. In
13-
quotes this template includes three date directives - %0d specifies that the day of the month be written out in one or two
12+
3. The template or pattern for the format is specified. In this case we use date directives to define the template. The quoted
13+
template includes three date directives - %0d specifies that the day of the month be written out in one or two
1414
digits, %b specifies that the month be written out in a three letter abbreviation, and %Y specifies that a 4-digit
15-
year be written out. These elements are separated by the tilde character (~). The pattern closes with spaces to account for
15+
year be written out. These elements are separated by the tilde character (~). The pattern closes with extra spaces to account for
1616
the length of labels.
17-
4. Next, in parentheses, the datatype is specified. The datatype= option can specify that the format is for a date,
18-
a time, or a datetime.
19-
5. In the PROC PRINT apply the format and see the results.
20-
6. Text can be combined with picture templates to create truly customized formats. Text be can be used for some levels of a
17+
4. The DATATYPE= option specifies that the format is a date, a time, or a datetime.
18+
5. Apply the format in PROC PRINT to view the results.
19+
6. Text can be combined with picture templates to create truly customized formats. Text be can be used for some levels of a
2120
format and date directives for other levels.
2221
7. SAS date constants (as well as time constants and datetime constants) can be used to specify the beginning and end of
2322
a date range.
24-
8. In using date directives remember that case can matter. A lower case b results in a 3-letter abbreviation for month, while
25-
an upper case B spells out the whole month.
23+
8. When using date directives, remember that case can matter. A lower case 'b' results in a 3-letter abbreviation for month, while
24+
an upper case 'B' spells out the whole month.
2625
************************************************************************************************/
2726

2827
proc format;

0 commit comments

Comments
 (0)