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

AIBCVT0.m

Go to the documentation of this file.
  1. AIBCVT0 ;IHS/DDPS/DFM-IBM STAT RECORDS CONTROL PARAMETERS [ 01/12/89 1:06 PM ]
  1. ;1.3; 1/13/89 CONTROLS FOR PARKLAWN AND NIH
  1. ;1.3; 9/23/88 RESTRUCTURE, ALLOW FOR REGISTRATION ELIGIBILITY FILE
  1. ;1.0; 3/28/88
  1. CONTROL ;READ CONTROL GLOBAL TO DETERMINE SYSTEM AND FIELD CHARACTERISTICS
  1. K AIBC,AIBB S AIBCS="",AIBCS=$O(^AIBCVTC("C",""_AIBGBLP_"",AIBCS))
  1. G:$L(AIBCS)>0 CTLFOUND
  1. S AIBA="A",AIBMSG="No Control Global Entry for "_AIBGBLP
  1. D ERRMSG^AIBCVT6 G RETURN
  1. CTLFOUND ;CONTROL GLOBAL FOUND FOR RECORDS SYSTEM
  1. S AIBCN1="",AIBCN2=0
  1. S AIBTGBL="",AIBTMP="",AIBTGLT="",AIBTGFT=""
  1. I $L(AIB2ND)=0 G NEWFILE
  1. I AIBCF=$P(^AIBCVTC(AIBCS,0),U,3)!((AIBFILE="ibmjob")&(AIBGBLP="AGEL")) S AIBT2="A" G CK2ND
  1. NEWFILE ;CREATE A NEW OUTPUT FILE
  1. S AIBT2="W" S:'$D(AIBOK) AIBFFN=""
  1. I AIBOS="D"!('$D(AIBT1)) G CK2ND
  1. S AIBMSG="File Created : "_AIBT1 D ERRMSG^AIBCVT6
  1. CK2ND ;CHECK IF TEMPORARY FILE FOR 2ND RECORD FORMAT IS NEEDED
  1. S AIB2ND=$P(^AIBCVTC(AIBCS,0),U,4)
  1. I $L(AIB2ND)=0 G GETNAME
  1. S AIBTGBL=$P(^AIBCVTC(AIB2ND,0),U,2),AIBTMP=U_AIBTGBL_"GLOB"
  1. S AIBTGLT=AIBTMP_"(AIBZ)",AIBTGFT=AIBTMP_"(AIBZ,AIBTZ)",AIBTZ(1)=0
  1. GETNAME ;GET OUTPUT FILE NAME
  1. S AIBCNM=$P(^AIBCVTC(AIBCS,0),U,1)
  1. S AIBCN3=""
  1. I AIBGBLP="AGEL" I AIBFILE="ibmjob" G CTLOOPN
  1. S AIBCF=$P(^AIBCVTC(AIBCS,0),U,3)
  1. CTLOOPN ;GET CONTROL FOR ALL NODES IN RECORD
  1. S AIBCN3=$O(^AIBCVTC(AIBCS,1,"C",AIBCN3)) G:AIBCN3="" CTLNDONE
  1. S AIBCN2=AIBCN2+1,AIBCF2=0,AIBCF3=""
  1. S AIBCN1="",AIBCN1=$O(^AIBCVTC(AIBCS,1,"C",AIBCN3,AIBCN1))
  1. S AIBC(AIBCN2)=^AIBCVTC(AIBCS,1,AIBCN1,0)
  1. CTLOOPF ;GET CONTROL FOR ALL FIELDS IN NODE
  1. S AIBCF3=$O(^AIBCVTC(AIBCS,1,AIBCN1,1,"C",AIBCF3))
  1. I AIBCF3="" G CTLFDONE
  1. S AIBCF2=AIBCF2+1
  1. S AIBCF1="",AIBCF1=$O(^AIBCVTC(AIBCS,1,AIBCN1,1,"C",AIBCF3,AIBCF1))
  1. S AIBC(AIBCN1,AIBCF2)=^AIBCVTC(AIBCS,1,AIBCN1,1,AIBCF1,0) G CTLOOPF
  1. CTLFDONE ;CONTROL FOR ALL FIELDS IN NODE LOADED
  1. S $P(AIBC(AIBCN2),U,3)=AIBCF2
  1. G CTLOOPN
  1. CTLNDONE ;CONTROL FOR ALL NODES LOADED
  1. S AIBCL=$P(AIBC(AIBCN2,AIBCF2),U,2),AIBL=$P(AIBC(AIBCN2,AIBCF2),U,3)
  1. S AIBRLN=AIBCL+AIBL-1
  1. S AIBC(0)=AIBCN2 I AIBFILE="keytap" S AIBJ="" G RETURN
  1. D ^AIBCVT00 G:AIBA="A" RETURN
  1. SETRJE ;SETUP TO GET RJE DATA
  1. S AIBB2=0,AIBB3=""
  1. CTLOOPB ;GET CONTROL INFORMATION FOR RJE JOB BYSYNC TELECOMMUNICATIONS CARD
  1. S AIBB3=$O(^AIBCVTC(AIBCS,2,"C",AIBB3))
  1. I AIBB2=0 I AIBB3="" S AIBA="A",AIBMSG="No Control Global Entry for "_AIBGBLP_" RJE Cards" D ERRMSG^AIBCVT6 G RETURN
  1. I AIBB3="" G RETURN
  1. S AIBB2=AIBB2+1,AIBB1="",AIBB1=$O(^AIBCVTC(AIBCS,2,"C",AIBB3,AIBB1))
  1. S AIBB(AIBB2)=^AIBCVTC(AIBCS,2,AIBB1,0)
  1. G CTLOOPB
  1. BJCL ;WRITE BEGINNING JCL FOR RJE BYSYNC JOB
  1. S AIBJ=0,AIBJC=$P(^AIBCVTC(AIBCS,0),U,5)
  1. BJCLOOP ;WRITE NEXT BEGINNING JCL CARD
  1. S AIBJ=$O(^AIBCVTJ(AIBJC,1,AIBJ)) G:AIBJ="" RETURN
  1. S AIBOT=$P(^AIBCVTJ(AIBJC,1,AIBJ,0),U,2)
  1. RESOLVE1 ;RESOLVE AREA CODES
  1. I AIBOT["|" S AIBOW=$P(AIBOT,"|",1),AIBTLN=$L(AIBOW)+2,AIBOW2=$E(AIBOT,AIBTLN,999),AIBOT=AIBOW_AIBJSAC_AIBOW2 G RESOLVE1
  1. RESOLVE2 ;DDPS REMOTE NUMBER
  1. I AIBOT["~" S AIBOW=$P(AIBOT,"~",1),AIBTLN=$L(AIBOW)+2,AIBOW2=$E(AIBOT,AIBTLN,999),AIBOT=AIBOW_AIBJSRD_AIBOW2 G RESOLVE2
  1. RESOLVE3 ;ACCOUNTING POINT
  1. I AIBOT["#" S AIBOW=$P(AIBOT,"#",1),AIBTLN=$L(AIBOW)+2,AIBOW2=$E(AIBOT,AIBTLN,999),AIBOT=AIBOW_AIBJSAP_AIBOW2 G RESOLVE3
  1. RESOLVE4 ;AREA NAME
  1. I AIBOT["@" S AIBOW=$P(AIBOT,"@",1),AIBTLN=$L(AIBOW)+2,AIBOW2=$E(AIBOT,AIBTLN,999),AIBOT=AIBOW_AIBJSAN_AIBOW2 G RESOLVE4
  1. RESOLVE5 ;PARKLAWN REMOTE NUMBER
  1. I AIBOT["`" S AIBOW=$P(AIBOT,"`",1),AIBTLN=$L(AIBOW)+2,AIBOW2=$E(AIBOT,AIBTLN,999),AIBOT=AIBOW_AIBJSRP_AIBOW2 G RESOLVE5
  1. RESOLVE6 ;NIH REMOTE NUMBER
  1. I AIBOT["!" S AIBOW=$P(AIBOT,"!",1),AIBTLN=$L(AIBOW)+2,AIBOW2=$E(AIBOT,AIBTLN,999),AIBOT=AIBOW_AIBJSRN_AIBOW2 G RESOLVE6
  1. K AIBOW2,AIBTLN
  1. D WRITE^AIBCVT3 S AIBCTJ=AIBCTJ+1 G BJCLOOP
  1. EJCL ;WRITE ENDING JCL FOR RJE BYSYNC JOB
  1. S AIBJ=0
  1. EJCLOOP ;WRITE NEXT ENDING JCL CARD
  1. S AIBJ=$O(^AIBCVTJ(AIBJC,2,AIBJ)) G:AIBJ="" RETURN
  1. S AIBOT=$P(^AIBCVTJ(AIBJC,2,AIBJ,0),U,2)
  1. D WRITE^AIBCVT3 S AIBCTJ=AIBCTJ+1 G EJCLOOP
  1. RETURN ;RETURN TO CALLING ROUTINE
  1. Q