Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: ACRFEXPU

ACRFEXPU.m

Go to the documentation of this file.
ACRFEXPU ;IHS/OIRM/DSD/AEF - EXPORT PROCESS CONTROL: UTILITY SUBROUTINES [ 10/27/2004   4:18 PM ]
 ;;2.1;ADMIN RESOURCE MGT SYSTEM;**3,13**;NOV 05, 2001
 ;
 ;This routine contains various utility subroutines used by the
 ;ACRFEXP routines
 ;
NEXTECS(ACRD0,ACRD1)         ;EP   ;ACR*2.1*3.12
 ;----- EXTRINSIC FUNCTION - RETURNS NEXT TREASURY ECS FILE NAME
 ;
 ;      INPUT:
 ;      ACRD0 = FY IEN IN 1166 APPROVALS FOR PAYMENT FILE
 ;      ACRD1 = BATCH IEN
 ;
 ;      RETURNS: NEXT TREASURY ECS FILE NAME
 ;
 ;MAKE HQ ECS FILES BEGIN WITH 1 INSTEAD OF 0 TO PREVENT CLASHING WITH
 ;AAO'S FILES ON THE SAME DISKETTE;MRS ;ALSO FOR BEMIDJI/ABERDEEN;MRS
 N I,X,Y,ACRAHN,ACRVAR
 D ^XBKVAR
 S ACRAHN=$$HOST^ACRFUTL
 S ACRVAR=1
 I ACRAHN="dpssyg" S ACRVAR=101 ;HEADQUARTERS AREA ;ACR*2.1*13.06 IM14144
 I ACRAHN="bjiao" S ACRVAR=101  ;BEMIDJI AREA      ;ACR*2.1*13.06 IM14144
 S Y=""
 S Y=$P($G(^AFSLAFP(ACRD0,1,ACRD1,2)),U,11)
 I Y']"" D
 . F I=ACRVAR:1:999 D  I '$D(^AFSLAFP(ACRD0,1,"G",X)) S Y=X Q
 .. S X=$$PAD^ACRFUTL(I,"L",3,0)_"-"_$E(DT,4,7)
 Q Y
HFS(ACRECS,ACRD0,%FILE,ACROUT)         ;EP
 ;----- CREATES AND OPENS UNIX ECS FILE
 ;
 ;      INPUT:
 ;      ACRECS = THE TREASURY ECS FILE NAME
 ;      ACRD0  = IEN OF THE FACILITY IN THE FMS SYSTEM DEFAULTS FILE
 ;
 ;      RETURNS:
 ;      %FILE  = ECS FILE NAME DEVICE NUMBER
 ;      ACROUT = QUIT CONTROLLER: 0=SUCCESSFUL, 1=UNSUCCESSFUL
 ;
 N ZISH1,ZISH2,ZISH3,X,Y
 S ACROUT=0
 ;S ZISH1=$P($G(^ACRSYS(ACRD0,402)),U,3)           ;ACR*2.1*13.06 IM14144
 S ZISH1=$$ARMSDIR^ACRFSYS(ACRD0)                  ;ACR*2.1*13.06 IM14144
 Q:ZISH1']""                                       ;ACR*2.1*13.06 IM14144
 S ZISH2=ACRECS
 S ZISH3="W"
 D HFS^ACRFUTL(ZISH1,ZISH2,ZISH3,.%FILE)
 I $G(%FILE)="" D  S ACROUT=1
 . W *7,!?5,"Unable to open host Treasury ECS file "_ACRECS
 . W !
 . H 2
 Q