Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Going back a specified number of days

Status
Not open for further replies.

gyounggido

Programmer
Feb 26, 2003
2
US
Hello, I have the following script which pulls inactive user accounts. I'd like to have this automatically go back 90 days without prompting the user for a date. I'm a VMS guy, so I'm used to just entering -90- for that. Unfortunately, this doesn't work in the particular utility I'm using (Datatrieve for VAX). Can someone please tell me what would be used in this case? I'm sure it's just a simple thing that's eluding me. Thanks in advance.

PROCEDURE SYSUAF_INACTIVITY_BCLUSTER
DECLARE CUTOFF_DATE USAGE DATE.
CUTOFF_DATE = *."Enter Cutoff Date"
READY IMBUAFDAT SHARED READ
REPORT IMBUAFDAT WITH
LLI BEFORE CUTOFF_DATE AND
LLN BEFORE CUTOFF_DATE AND
LLI AFTER "17-NOV-1858" AND
LLN AFTER "17-NOV-1858" ON OPER_ROOT:[U634390]IMBINACT.DAT
SET REPORT_NAME = "BCLUSTER Inactive User Account Report"
PRINT USERNAME,
OWNER,
LLI ("LAST"/"INTERACTIVE"/"LOGIN"),
LLN ("LAST"/"NON-INTERACTIVE"/"LOGIN")
AT BOTTOM OF REPORT PRINT SKIP, COL 10,
"Total Inactive Accounts:", SPACE, COUNT (-), SKIP, COL 10,
"Login Cutoff Date Used :", SPACE, CUTOFF_DATE (-)
END_REPORT
FINISH
RELEASE CUTOFF_DATE
END_PROCEDURE
 
Hi,
i'm not sure if this is what you are after but....
It looks like you are accepting from "Date" (i.e. format yymmdd),
if you accept from "Day" (i.e. julien format yyddd) then the add or subtract number of days is much easier.
Hope this is of some use.
B.
 
Hmm...I guess I would have to change it in the initial record, right? Here's what I'm pulling this from:

(this is a VMS UAF (User Authorization File) printout:
RECORD SYSUAF_RECORD
!
! The SYSUAF.DAT file. Has user accounts, etc. Normally accessed through
! AUTHORIZE, but if done read-only interesting data may be obtained.
!
! The user must have the proper privileges to access SYSUAF.DAT
!
!
01 SYSUAF_REC.
10 IDENT.
20 RTYPE USAGE BYTE.
20 VERSION USAGE BYTE.
20 INULL USAGE WORD.
10 USERDATA.
20 USERNAME PIC X(32) EDIT_STRING T(14). ! key
20 HIDE_UIC.
30 FILLER PIC XXXX.
20 UIC REDEFINES HIDE_UIC.
30 LUIC USAGE LONG. ! key
20 UIC_WORDS REDEFINES HIDE_UIC.
30 MEMBER USAGE WORD.
30 GROUP USAGE WORD.
!
! Using the added FAO function
! this can be formatted in much neater ways than a decimal long word.
!
! 20 NUMERIC COMPUTED BY FN$FAO("!%U", LUIC, 0,0,0,0,0,0,0)
! EDIT_STRING X(9).
! 20 IDENTIFIER COMPUTED BY FN$FAO("!%I", LUIC, 0,0,0,0,0,0,0)
! EDIT_STRING X(22).
20 SUB_ID USAGE LONG EDIT_STRING Z9.
20 PARENT_ID USAGE QUAD EDIT_STRING Z9. ! key
20 ACCOUNT PIC X(8). ! ought to be key
20 FILLER PIC X(24). ! expansion of account someday
20 OWNER_FIELD_LENGTH USAGE BYTE EDIT_STRING Z9.
20 OWNER PIC X(31).
10 DEFAULTS.
20 DEVICE_FIELD_LENGTH USAGE BYTE EDIT_STRING Z9.
20 DEVICE PIC X(31) EDIT_STRING T(16).
20 DIRECTORY_FIELD_LENGTH USAGE BYTE EDIT_STRING Z9.
20 DIRECTORY PIC X(63) EDIT_STRING T(16).
20 LGICMD_FIELD_LENGTH USAGE BYTE EDIT_STRING Z9.
20 LGICMD PIC X(63) EDIT_STRING T(12).
20 CLI_FIELD_LENGTH USAGE BYTE EDIT_STRING Z9.
20 CLI PIC X(31) EDIT_STRING T(8).
20 TABLES_FIELD_LENGTH USAGE BYTE EDIT_STRING Z9.
20 TABLES PIC X(31) EDIT_STRING T(12).
10 PASSWORD.
20 PWD USAGE QUAD.
20 PWD2 USAGE QUAD.
20 LOGFAILS USAGE WORD EDIT_STRING ZZ9.
20 SALT USAGE WORD.
20 ENCRYPT USAGE BYTE.
20 ENCRYPT2 USAGE BYTE.
10 PASSWORD_DATES.
20 PWD_LENGTH USAGE BYTE EDIT_STRING Z9.
20 FILLER PIC X.
20 EXPIRATION USAGE QUAD.
20 PWD_LIFETIME USAGE QUAD.
! 20 LIFETIME COMPUTED BY CHOICE OF
! PWD_LIFETIME NE 0 THEN FN$FROM_INTERNAL(22, PWD_LIFETIME)
! ELSE 0
! END_CHOICE.
20 PWD_DATE USAGE DATE.
20 PWD_TIME COMPUTED BY FN$TIME(PWD_DATE) EDIT_STRING X(11).
20 PWD2_DATE USAGE DATE.
20 PWD2_TIME COMPUTED BY FN$TIME(PWD2_DATE) EDIT_STRING X(11).
10 LOGIN_DATES.
20 LAST_LOGIN_I USAGE DATE QUERY_NAME IS LLI.
20 TIME_LAST_LOGIN_I COMPUTED BY FN$TIME(LLI)
EDIT_STRING X(11).
20 LAST_LOGIN_N USAGE DATE QUERY_NAME IS LLN.
20 TIME_LAST_LOGIN_N COMPUTED BY FN$TIME(LLN)
EDIT_STRING X(11).
10 PRIVILEGES.
20 PRIV USAGE QUAD.
20 DEF_PRIV USAGE QUAD.
! 20 MIN_CLASS PIC X(20) EDIT_STRING T(8).
! 20 MAX_CLASS PIC X(20) EDIT_STRING T(8).
20 FILLER PIC X(40).
20 LOGIN_FLAGS USAGE LONG.
10 ACCESS.
20 NETWORK_ACCESS_BYTES OCCURS 6 TIMES. ! 3 primary, 3 secondary
30 NETWORK_ACCESS_BYTE USAGE BYTE.
20 BATCH_ACCESS_BYTES OCCURS 6 TIMES.
30 BATCH_ACCESS_BYTE USAGE BYTE.
20 LOCAL_ACCESS_BYTES OCCURS 6 TIMES.
30 LOCAL_ACCESS_BYTE USAGE BYTE.
20 DIALUP_ACCESS_BYTES OCCURS 6 TIMES.
30 DIALUP_ACCESS_BYTE USAGE BYTE.
20 REMOTE_ACCESS_BYTES OCCURS 6 TIMES.
30 REMOTE_ACCESS_BYTE USAGE BYTE.
20 FILLER PIC X(12).
20 PRIME_DAYS USAGE BYTE. ! monday bit 0, sunday bit 6
20 FILLER USAGE BYTE.
10 QUOTA1.
20 PRI USAGE BYTE EDIT_STRING Z9.
20 QUEPRI USAGE BYTE EDIT_STRING Z9.
20 MAX_JOBS USAGE WORD EDIT_STRING Z9.
20 MAX_ACCT_JOBS USAGE WORD EDIT_STRING Z9.
20 MAX_DETACH USAGE WORD EDIT_STRING.
20 PRCLM USAGE WORD. ! or PRCCNT
20 BIOLM USAGE WORD.
20 DIOLM USAGE WORD.
20 TQELM USAGE WORD. ! or TQCNT
20 ASTLM USAGE WORD.
20 ENQLM USAGE WORD.
20 FILLM USAGE WORD.
20 SHRFILLM USAGE WORD.
10 QUOTA2.
20 WSQUO USAGE LONG.
20 WSDEF USAGE LONG. ! DFWSCNT
20 WSEXTENT USAGE LONG.
20 PGFLQUOTA USAGE LONG.
20 CPUTIM USAGE LONG EDIT_STRING Z9.
20 BYTLM USAGE LONG.
20 PBYTLM USAGE LONG EDIT_STRING Z9.
20 JTQUO USAGE LONG.
10 QUOTA3.
20 PROXY_LIM USAGE WORD.
20 PROXIES USAGE WORD.
20 ACCOUNT_LIM USAGE WORD.
20 ACCOUNTS USAGE WORD.
10 FILLER PIC X(64). ! filler to first record size
10 END_FILLER. ! filler to second record size
20 STUFFIT OCCURS 0 TO 1 TIMES DEPENDING ON INULL.
30 FILLER PIC X(255).
30 FILLER PIC X(255).
30 FILLER PIC X(255).
30 FILLER PIC X(3).
;

I'm still new to this. I'm decent with DCL, but once it gets away from that, I start to develop the glazed-over look. Thanks for you suggestion!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top