It is currently Mon Mar 18, 2024 7:17 pm


All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 76 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7, 8  Next
Author Message
 Post subject: Re: More MUMPS V1 utility
PostPosted: Sun Oct 23, 2011 4:04 am 
User avatar

Joined: Mon Nov 01, 2010 3:33 pm
Posts: 104
Location: Australia
Real Name: Ray Newman
Began Programming in MUMPS: 01 Jul 1976
Sorry Josef, I don't understand the question.

Ray


Top
Offline Profile  
 
 Post subject: Re: More MUMPS V1 utility
PostPosted: Sun Oct 23, 2011 4:50 am 
User avatar

Joined: Sun Mar 27, 2011 8:12 am
Posts: 87
Location: Europe , HUNGARY
Real Name: Josef Nagy
Began Programming in MUMPS: 0- 0-1991
Ray

Why not during possible Journaling function to activate ?
If MV1 is runing , and Journaling is ON , after stop the journal / S ^$SYSTEM("VOL",1,"JOURNAL_REQUESTED")=0 / the next journal starting is failed . Need a restart MV1 for activate the journaling ?

_________________
Josef Nagy
[MUMPS based industrial application in Processing Controll (MCU/PLC/MUX)]


Top
Offline Profile  
 
 Post subject: Re: More MUMPS V1 utility
PostPosted: Sun Oct 23, 2011 1:06 pm 
User avatar

Joined: Mon Nov 01, 2010 3:33 pm
Posts: 104
Location: Australia
Real Name: Ray Newman
Began Programming in MUMPS: 01 Jul 1976
I have never tried turning off the journal then turning it back on.
For backup, I use:
/usr/bin/mumps -x 'S ^$S("VOL",1,"WRITELOCK")=1' /one/onedb
echo `date` ONE environment write locked.
cp /Volumes/Journal/journal.dat journal.bak/journal`date "+%Y%m%d"`
/usr/bin/mumps -x 'S ^$S("VOL",1,"JOURNAL_SIZE")=0' /one/onedb
echo `date` ONE Journal coppied to journal.bak and zeroed.
#Now we start backing up tape first.
bru -cf ntape0 /
if ($status) then
echo `date` ERROR - tape backup FAILED.
else
echo `date` ONE and OSX/Network data backed up to tape.
endif
/usr/bin/mumps -x 'S ^$S("VOL",1,"WRITELOCK")=0' /one/onedb
echo `date` ONE Database write enabled.

Ray


Top
Offline Profile  
 
 Post subject: Re: More MUMPS V1 utility
PostPosted: Sun Oct 23, 2011 11:04 pm 
User avatar

Joined: Sun Mar 27, 2011 8:12 am
Posts: 87
Location: Europe , HUNGARY
Real Name: Josef Nagy
Began Programming in MUMPS: 0- 0-1991
This is a simple localTCP DeJournaling Utility :

MUMPS Code :
=============================================
DEJOURN ;DeJournaling | Restore Data from Journal
N $ET ;S $ET="D ^%ET"
ST W !," MUMPS V1 DeJournaling Utility",!
S FILE=$G(^$SYSTEM("VOL",1,"JOURNAL_FILE"))
W !,"Default journal file : "_FILE,!
ASK ;-- Selecting data criterial
R "DeJournaling All Global (Y/N)?: ",AGL,! Q:AGL=""
I AGL="N" R "Global : ",GBL,!
R "DeJournaling All Action /All/SET/KILL (A/S/K)?: ",AAC,! Q:AAC=""
R "DeJournaling Sarting date <yyyymmdd/Enter-All>: ",STD,!
R "DeJournaling Last date <yyyymmdd/Enter-Today> : ",LTD,!
S GBL=$G(GBL),STD=$G(STD),STDN="" S:STD'="" STDN=$$^%ZDH(STD)
S LTD=$G(LTD),LTDN="" S:LTD'="" LTDN=$$^%ZDH(LTD)
S AAC=$G(AAC,"A"),AAC=$S(AAC="A":"ALL",AAC="S":"SET",AAC="K":"KILL",1:AAC),ACS="D" D RJF
R "DeJournaling selected items (Y/N) ? : ",PSA,!
I PSA="Y" D
.W !,"Restoring selected items ...."
.S recl=0,rec="" F S rec=$O(^MTEMP($J,rec)) Q:rec="" S PP=$G(^MTEMP($J,rec)) Q:PP="" X PP W !,PP_" done." S recl=rec
.W !,$G(recl)_" actions restored done.",!
G ST Q
RJF ;--- Read Journal File & Save selection to ^MTEMP($J,...
K ^MTEMP($J) S DD=$C(34) I '$&%FILE(FILE,"EXISTS") W "NO SUCH FILE",! Q
C 1 O 1:(FILE:"R") U 1:("TERMINATOR=")
R MAGIC#4,OFFSET#8 U 0 S MAGIC=$$CVT(MAGIC),OFFSET=$$CVT(OFFSET)
I MAGIC-4155766916 W "Invalid MAGIC number",! C 1 Q
W "Date/Time",?24,"Action",?31,"UCI",?35,"Reference/Data",!
S OFF=12,rec=0 F Q:OFF'<OFFSET D
.U 1 R TIME#8 U 0 S SIZE=$$CVT($E(TIME,1,2)),UCI=$A(TIME,4),ACTION=$A(TIME,3),UCIN=""
.S:UCI'="" UCIN=$G(^$SYSTEM("VOL",1,"UCI",UCI))
.S TIME=$$CVT($E(TIME,5,8)),TIME=(TIME\86400+47117)_","_(TIME#86400)
.S ACTION=$S(ACTION=5:"KILL",ACTION=4:"SET",ACTION=3:"ESTOP",ACTION=2:"STOP",ACTION=1:"START",'ACTION:"CREATE")
.I SIZE=8 S OFF=OFF+SIZE Q
.S:SIZE#4 SIZE=SIZE\4+1*4 S OFF=OFF+SIZE U 1 R DATA#(SIZE-8) U 0
.S NAME=$TR($E(DATA,1,8),$C(0)),SLEN=$A(DATA,9),DATA=$E(DATA,10,99999)
.Q:(GBL'="")&(GBL'=NAME)
.Q:(STD'="")&(STDN>+TIME)
.Q:(LTD'="")&(LTDN<+TIME)
.Q:(AAC'="ALL")&(AAC'=ACTION)
.S KEY=$$FULLUNK^FIX1($E(DATA,1,SLEN)),DATA=$E(DATA,SLEN+1,99999)
.S REF="^"_NAME_$S(SLEN:"("_KEY_")",1:"")
.S:ACTION="SET" DBC=$$CVT($E(DATA,1,2)),DATA=$$DISP^%U($E(DATA,3,DBC+2)) S rec=rec+1
.I ACS="D" W $$D^%D(+TIME)," ",$$T^%T($P(TIME,",",2)),?24,ACTION,?31,UCIN,?35,REF W:ACTION="SET" "=",DATA W !
.S ^MTEMP($J,rec)=ACTION_" ^["_DD_UCIN_DD_"]"_$E(REF,2,999)_$S(ACTION="SET":"="_DD_DATA_DD,1:"")
C 1 W !,$G(rec)_" items listed.",!
Q
CVT(BIN,I) S I=0 F S I=I*256+$A(BIN,$L(BIN)),BIN=$E(BIN,1,$L(BIN)-1) Q:'$L(BIN)
Q I
INT(FILE,AGL,GBL,ACC,STD,LTD,PSA) ;Internal Call
;--- FILE = Journal File *full name*
; AGL = All global Y/N
; GBL = Selected Global name
; ACC = All action A/S/K
; STD = Starting Date 'yyyymmdd'
; LTD = Last Date 'yyyymmdd'
; PSA = Processing Status Y/N > Y=eXecute actions
S GBL=$G(GBL),STD=$G(STD),STDN="" S:STD'="" STDN=$$^%ZDH(STD)
S LTD=$G(LTD),LTDN="" S:LTD'="" LTDN=$$^%ZDH(LTD) S PSA=$G(PAS,"N"),recl=0
S AAC=$G(AAC,"A"),AAC=$S(AAC="A":"ALL",AAC="S":"SET",AAC="K":"KILL",1:AAC),ACS="D" D RJF
I PSA="Y" S recl=0,rec="" F S rec=$O(^MTEMP($J,rec)) Q:rec="" S PP=$G(^MTEMP($J,rec)) Q:PP="" X PP W !,PP_" done." S recl=rec
Q recl
=============================================

_________________
Josef Nagy
[MUMPS based industrial application in Processing Controll (MCU/PLC/MUX)]


Top
Offline Profile  
 
 Post subject: Re: More MUMPS V1 utility
PostPosted: Tue Oct 25, 2011 6:05 am 
User avatar

Joined: Sun Mar 27, 2011 8:12 am
Posts: 87
Location: Europe , HUNGARY
Real Name: Josef Nagy
Began Programming in MUMPS: 0- 0-1991
Enable / Disable or Listing status of globals to JOURNALING

MUMPS code:
=================================================
%JOURNAL ;Set Global(s) to JOURNALING
W !," Set Global(s) to Journaling",!!
R !,"Enable/Disable or Listing Journaling (E/D/L) ?: ",%GF Q:%GF="" Q:(%GF'="E")&(%GF'="D")&(%GF'="L")
R !,"Global(s): ",GLO Q:GLO=""
D INT(GLO) Q
INT(GLO,%,VOL,UCI,G,ZR) N $ET S ZR="INT^%JOURNAL",$ET="D EX^%JOURNAL"
S UI=$$UI^%U() K ^UTILITY(UI) S GLO=$$PAT^%U(GLO)
D INT^%GD(3,GLO,^$J($J,"GLOBAL"),"","z","^UTILITY("_UI_")")
I $O(^UTILITY(UI,""))="" W !,"?No globals selected.",! Q
S %=^$J($J,"GLOBAL_VOL"),VOL=^$S("VOL",%,"NAME")
S UCI=^$S("VOL",%,"UCI",^$J($J,"GLOBAL"))
G:%GF="L" LS
SET ;Set Journal Flag
S GLO="" F S GLO=$O(^UTILITY(UI,GLO)) Q:GLO="" D
.I %GF="E" S ^$G(GLO,"JOURNAL")=1
.I %GF="D" S ^$G(GLO,"JOURNAL")=0
LS ;List global as journal
W !,"Global | Journal Status"
S $E(BLL,80)=" ",GLO="" F S GLO=$O(^UTILITY(UI,GLO)) Q:GLO="" D
.S fl=$G(^$G(GLO,"JOURNAL")) W !,$E(GLO_BLL,1,8)_" = "_$S(fl=1:"ON",1:"OFF")
Q
EX W ! Q
=========================================================

_________________
Josef Nagy
[MUMPS based industrial application in Processing Controll (MCU/PLC/MUX)]


Top
Offline Profile  
 
 Post subject: Re: More MUMPS V1 utility
PostPosted: Wed Oct 26, 2011 1:47 pm 
User avatar

Joined: Sun Mar 27, 2011 8:12 am
Posts: 87
Location: Europe , HUNGARY
Real Name: Josef Nagy
Began Programming in MUMPS: 0- 0-1991
New Utility : MV1 GUI Global Editor
(now under testing period , in this week will available download .....)


Attachments:
File comment: GUI Global Editor
MV1GED2.JPG
MV1GED2.JPG [ 154.68 KiB | Viewed 76566 times ]

_________________
Josef Nagy
[MUMPS based industrial application in Processing Controll (MCU/PLC/MUX)]
Top
Offline Profile  
 
 Post subject: Re: More MUMPS V1 utility
PostPosted: Wed Oct 26, 2011 2:03 pm 
User avatar

Joined: Sun Mar 27, 2011 8:12 am
Posts: 87
Location: Europe , HUNGARY
Real Name: Josef Nagy
Began Programming in MUMPS: 0- 0-1991
Ray please help me...

When runing a %GS utility was a MUMPS_CRASH .
This is my first CRASH !
----------------------------------------------------------------------
MUMPS CRASH OCCURED on Tue Oct 25 15:29:11 2011
MUMPS V1.53 for Linux i686
FATAL MUMPS ERROR occured - pid 2015!!
Get_block: lseek() failed!
errno = 22 Invalid argument
Job No 3
Uci: 2 Routine: %GS Line: 17
Last Global: ^MPACU
------------------------------------------------------------------------

The error : Get_block: lseek() failed , a disk error ? Because the ^IC utility show 7 block pointer error .
Now restore the last backup database and reload the new-actual routines , and working normaly.
I may have forgotten to stop/shutdown it sometime it MV1 ? But in Linux system shutdown (Ubuntu RC6 level) is MV1 STOP is avtive ....
Anything Your Idea ?

_________________
Josef Nagy
[MUMPS based industrial application in Processing Controll (MCU/PLC/MUX)]


Top
Offline Profile  
 
 Post subject: Re: More MUMPS V1 utility
PostPosted: Wed Oct 26, 2011 2:23 pm 
User avatar

Joined: Mon Nov 01, 2010 3:33 pm
Posts: 104
Location: Australia
Real Name: Ray Newman
Began Programming in MUMPS: 01 Jul 1976
A linux shutdown of an active MUMPS system CAN cause database corruption which could cause the above problem. Put the following line in the linux rc.shutdown (or whatever linux calls that file):
/usr/bin/mumps -x D ^SSD /yourdatabase

Ray


Top
Offline Profile  
 
 Post subject: Re: More MUMPS V1 utility
PostPosted: Thu Oct 27, 2011 4:17 am 
User avatar

Joined: Sun Mar 27, 2011 8:12 am
Posts: 87
Location: Europe , HUNGARY
Real Name: Josef Nagy
Began Programming in MUMPS: 0- 0-1991
The new version of MV1SysTray2 is available :
www.cais-system.com/MUMPS/MV1_SysTray_U ... rsion_2_0/
(with GUI Global Editor)

_________________
Josef Nagy
[MUMPS based industrial application in Processing Controll (MCU/PLC/MUX)]


Top
Offline Profile  
 
 Post subject: Re: More MUMPS V1 utility
PostPosted: Sun Oct 30, 2011 12:20 am 
User avatar

Joined: Sun Mar 27, 2011 8:12 am
Posts: 87
Location: Europe , HUNGARY
Real Name: Josef Nagy
Began Programming in MUMPS: 0- 0-1991
In the new release of MV1SysTray2 is available :
www.cais-system.com/MUMPS/MV1_SysTray_U ... date_2_01/
In GUI Global Editor : [Next] & [Prev] options !!
and this function working in command line : %GSEL utility (output to ^MTEMP($j,... )
Usage , ex.: ^GLOBAL/M100 (Next 100 record)
^GLOBAL/M-100 (Prev. 100 record)
if need a record order reverse , use : $$RO^%GSEL() /return number of record/

_________________
Josef Nagy
[MUMPS based industrial application in Processing Controll (MCU/PLC/MUX)]


Top
Offline Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 76 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7, 8  Next

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Theme created StylerBB.net