-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathadd-branch-to-user.pick
42 lines (35 loc) · 1.29 KB
/
add-branch-to-user.pick
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
PGM = 'VZ.USER.BRANCH'
*** Add new branch to user IF user does not have it
*-------------------------------------------------------------------------*
GET(ARG.)NEW
IF NEW = '0' THEN
PRINT 'Specify which branch to add.'
END
ELSE
GOSUB DOIT
END
RETURN
*-------------------------------------------------------------------------*
DOIT: *** Check if Branch assigned, if not, then assign it to user.
OPEN 'INITIALS' TO USER ELSE STOP
CMD = 'SELECT INITIALS WITH NO.LOGON # "1"'
CMD:= ' AND MESSAGE.GROUP = "" AND HOME_BR # "PT"'
! CMD:= ' AND @ID = "TEST"'
EXECUTE CMD
LOOP
READNEXT ID ELSE EXIT
READV BR FROM USER,ID,9 ELSE BR = ''
CONVERT VM TO @FM IN BR
LOCATE NEW IN BR SETTING J THEN
PRINT ID: ' already has "':NEW:'"'
END
ELSE
PRINT ID: ' - inserting branch "': NEW : '"'
BR = INSERT(BR,J;NEW)
CONVERT @FM TO @VM IN BR
WRITEV BR ON USER,ID,9
END
REPEAT
RETURN
*-------------------------------------------------------------------------*
!ZELENKO~08/24/17~13:03