
Caution! This message was sent from outside the University of Manitoba.
Dear list, I am experiencing a fairly steep learning curve trying to write quite basic .pgm script files for the new post-2018 EpiData Analysis guided by the introductory text on the epidata website and the commands.html reference.
I have searched the web for relevant tutorials, courses or examples, but cannot find any. Could anybody on the list be willing to share some programming examples for example on the examples page on Epidata.dk (or elsewhere)?
BTW: Does the new Analysis allow for a parallel to the user input command in Classic:
globalvariable=trim("?Input value?")
Thanks for any hints or links.
Regards, Vegard Hoegli MD, MPH

Caution! This message was sent from outside the University of Manitoba.
The help menu item should load the local document commands.html which has a full description of all new analysis commands. The commands and functions are similar to classic epidata, but there are summer important differences.
The difference that is easy to forget is that you must use := in an assignment varx := 25; and to give a value to some command parameters scatter varX varY !xmax:=100;
There are a lot of simple examples in the help document.
You can still use @varx to put the value of varx into the command. But we have not implemented ? to request user input, as far as I recall.
If anyone has useful, validated examples of .pgm code, I will add them to a separate tutorial file.
Jamie
Dear list, I am experiencing a fairly steep learning curve trying to write quite basic .pgm script files for the new post-2018 EpiData Analysis guided by the introductory text on the epidata website and the commands.html reference.
I have searched the web for relevant tutorials, courses or examples, but cannot find any. Could anybody on the list be willing to share some programming examples for example on the examples page on Epidata.dk (or elsewhere)?
BTW: Does the new Analysis allow for a parallel to the user input command in Classic:
globalvariable=trim("?Input value?")
Thanks for any hints or links.
Regards, Vegard Hoegli MD, MPH

Caution! This message was sent from outside the University of Manitoba.
Thank you, Jamie, for the quick response. I have tried to study the Commands file, and I apologize if I overlook something, but: - How do I do Imif - else - endif? - How do I print Titles and comments over tables and graphs? - How to select all records. select; returns error message,
It would be very helpful to see some real-world script files for better understanding structure and flow. Thank you again for your patience!
Vegard
fre. 14. feb. 2025 kl. 19:24 skrev EpiData support and user community <epidata-list@lists.umanitoba.camailto:epidata-list@lists.umanitoba.ca>: Caution! This message was sent from outside the University of Manitoba.
The help menu item should load the local document commands.html which has a full description of all new analysis commands. The commands and functions are similar to classic epidata, but there are summer important differences.
The difference that is easy to forget is that you must use := in an assignment varx := 25; and to give a value to some command parameters scatter varX varY !xmax:=100;
There are a lot of simple examples in the help document.
You can still use @varx to put the value of varx into the command. But we have not implemented ? to request user input, as far as I recall.
If anyone has useful, validated examples of .pgm code, I will add them to a separate tutorial file.
Jamie
Dear list, I am experiencing a fairly steep learning curve trying to write quite basic .pgm script files for the new post-2018 EpiData Analysis guided by the introductory text on the epidata website and the commands.html reference.
I have searched the web for relevant tutorials, courses or examples, but cannot find any. Could anybody on the list be willing to share some programming examples for example on the examples page on Epidata.dk (or elsewhere)?
BTW: Does the new Analysis allow for a parallel to the user input command in Classic:
globalvariable=trim("?Input value?")
Thanks for any hints or links.
Regards, Vegard Hoegli MD, MPH
Archives: https://lists.umanitoba.ca/hyperkitty/list/epidata-list@lists.umanitoba.ca/m...

Caution! This message was sent from outside the University of Manitoba.
First of all, thank you for your comments and questions. There are some deficiencies in the help file that need to be addressed.
imif There is no command imif. Was this an Epi Info command? If ... then ... is not documented in the help file for some reason. I'll add it to the next release. Basically if ... then goes like this example:
new global q integer; q := 1; if (q=1) then begin means var1; end else begin scatter var2 var1; end;
Only the means command gets executed. IF is meant to query some global variable, or a result variable, not a data variable.
If you want to perform some calculation on a data variable that depends on another data variable, you can use the iif function or a select
// var1 has values 1 or 0 // var2 is an integer variable, which should be 20 if var1 is 0 and 50 if var1 is 1 var2 := iif(var1 = 0, 20, 50);
Or do it this way
select (var1 = 0) do var2 := 20; select (var1 = 1) do var2 := 50;
Select all records The select command only has effect for the command or block of commands that immediately follow the do. This is an important difference from classic epidata. It also seems that select is not documented, although it does appear in at least one example.
Print titles The graph commands all have a title option, because they open in separate windows or get saved without the context of commands.. For example,
epicurve onsetdate !title:="Salmonella outbreak - cases by date of onset";
The statistical commands do not have a title option, but you can do this with the command ?, which prints anything you want.
?"Table 1. Number of cases by gender and age group"; select (case=1) do tab gender agegroup;
We have been slow getting new releases out. In the queue are some more graph commands; clearly a revised commands.html is needed now.
Jamie On Feb 14, 2025, at 6:14 PM, EpiData support and user community <epidata-list@lists.umanitoba.camailto:epidata-list@lists.umanitoba.ca> wrote:
I have tried to study the Commands file, and I apologize if I overlook something, but: - How do I do Imif - else - endif? - How do I print Titles and comments over tables and graphs? - How to select all records. select; returns error message,
It would be very helpful to see some real-world script files for better understanding structure and flow. Thank you again for your patience!
Vegard

Caution! This message was sent from outside the University of Manitoba.
Thank you, Jamie, your post is very helpful! With my outdated general programming skills I would never have guessed this!
Imif (immediate if), I have used in EpiData classic pgm like this:
count imif $COUNT =0 then type "No data meet criteria in the table" else tab avd bokomm /M endif
Again, BIG thankyou to all EpiData developers who constantly develop this powerful tool, and for all help on this list forum!
Vegard
lør. 15. feb. 2025 kl. 03:55 skrev EpiData support and user community <epidata-list@lists.umanitoba.camailto:epidata-list@lists.umanitoba.ca>: Caution! This message was sent from outside the University of Manitoba.
First of all, thank you for your comments and questions. There are some deficiencies in the help file that need to be addressed.
imif There is no command imif. Was this an Epi Info command? If ... then ... is not documented in the help file for some reason. I'll add it to the next release. Basically if ... then goes like this example:
new global q integer; q := 1; if (q=1) then begin means var1; end else begin scatter var2 var1; end;
Only the means command gets executed. IF is meant to query some global variable, or a result variable, not a data variable.
If you want to perform some calculation on a data variable that depends on another data variable, you can use the iif function or a select
// var1 has values 1 or 0 // var2 is an integer variable, which should be 20 if var1 is 0 and 50 if var1 is 1 var2 := iif(var1 = 0, 20, 50);
Or do it this way
select (var1 = 0) do var2 := 20; select (var1 = 1) do var2 := 50;
Select all records The select command only has effect for the command or block of commands that immediately follow the do. This is an important difference from classic epidata. It also seems that select is not documented, although it does appear in at least one example.
Print titles The graph commands all have a title option, because they open in separate windows or get saved without the context of commands.. For example,
epicurve onsetdate !title:="Salmonella outbreak - cases by date of onset";
The statistical commands do not have a title option, but you can do this with the command ?, which prints anything you want.
?"Table 1. Number of cases by gender and age group"; select (case=1) do tab gender agegroup;
We have been slow getting new releases out. In the queue are some more graph commands; clearly a revised commands.html is needed now.
Jamie On Feb 14, 2025, at 6:14 PM, EpiData support and user community <epidata-list@lists.umanitoba.camailto:epidata-list@lists.umanitoba.ca<mailto:epidata-list@lists.umanitoba.camailto:epidata-list@lists.umanitoba.ca>> wrote:
I have tried to study the Commands file, and I apologize if I overlook something, but: - How do I do Imif - else - endif? - How do I print Titles and comments over tables and graphs? - How to select all records. select; returns error message,
It would be very helpful to see some real-world script files for better understanding structure and flow. Thank you again for your patience!
Vegard
Archives: https://lists.umanitoba.ca/hyperkitty/list/epidata-list@lists.umanitoba.ca/

Caution! This message was sent from outside the University of Manitoba.
Ah, yes. Thanks, Vegard. It’s been a long time since I did anything in classic epidata analysis or epiinfo and I use a Mac, so can’t easily run either now. Jamie
On Feb 15, 2025, at 4:26 AM, EpiData support and user community epidata-list@lists.umanitoba.ca wrote:
count imif $COUNT =0 then type "No data meet criteria in the table" else tab avd bokomm /M endif

Caution! This message was sent from outside the University of Manitoba.
I will prepare a collection of pgm files for general inspiration.
Another question was searching the archives. I have not had the time to look into that, but a general search in a browser revealed new aspects:
epidata list how to select
Will list a number of tutorials, including
https://vbn.aau.dk/ws/portalfiles/portal/443515822/DMD_book.pdf
Bw Jens Lauritsen Den 14. feb. 2025, fra 17.58, EpiData support and user community <epidata-list@lists.umanitoba.camailto:epidata-list@lists.umanitoba.ca> skrev:
Caution! This message was sent from outside the University of Manitoba.
Dear list, I am experiencing a fairly steep learning curve trying to write quite basic .pgm script files for the new post-2018 EpiData Analysis guided by the introductory text on the epidata website and the commands.html reference.
I have searched the web for relevant tutorials, courses or examples, but cannot find any. Could anybody on the list be willing to share some programming examples for example on the examples page on Epidata.dkhttp://Epidata.dk (or elsewhere)?
BTW: Does the new Analysis allow for a parallel to the user input command in Classic:
globalvariable=trim("?Input value?")
Thanks for any hints or links.
Regards, Vegard Hoegli MD, MPH Archives: https://lists.umanitoba.ca/hyperkitty/list/epidata-list@lists.umanitoba.ca/m...
participants (1)
-
EpiData support and user community